Ver Mensaje Individual
  #2 (permalink)  
Antiguo 22/08/2004, 13:19
depr05
 
Fecha de Ingreso: junio-2004
Mensajes: 20
Antigüedad: 20 años, 8 meses
Puntos: 0
Gracias a los que vieron mi mensaje y no me ayudaron aki esta el script

Espero que a alguien le sirva el script y si lo mejora me lo haga saber
ya que muchos vieron mi problema y no me ayudaron, por suerte pude resolver mi problema y lo puedo compartir con otros....

Que lo disfruten Gracias....

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Paso de valores de un select multiple a una caja de texto</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
function paso(){
var indice

indice=document.form1.agenda.selectedIndex

var valor
valor=document.form1.agenda.options[indice].value
if(form1.direcciones.value==""){
form1.direcciones.value=valor
}
else{
var texto
texto=form1.direcciones.value
form1.direcciones.value=texto + ", " + valor
}
}
</script>
</head>

<body>
<form name="form1" method="post" action="" onDblClick="paso()">
<table width="48%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="70%"><font size="2" face="Arial, Helvetica, sans-serif">correo:</font>
<input name="direcciones" type="text" id="direcciones2" size="40"></td>
<td width="11%" rowspan="6"><select name="agenda" size="8" multiple id="select">
<option value="[email protected]">uno</option>
<option value="[email protected]">dos</option>
<option value="[email protected]">tres</option>
<option value="[email protected]">cuatro</option>
<option value="[email protected]">cinco</option>
<option value="[email protected]">seis</option>
<option value="[email protected]">siete</option>
</select></td>
<td width="19%">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</form>
</body>
</html>