Ver Mensaje Individual
  #2 (permalink)  
Antiguo 27/08/2006, 17:59
php.java.jsp
 
Fecha de Ingreso: octubre-2004
Mensajes: 128
Antigüedad: 19 años, 6 meses
Puntos: 2
quizas esto es lo que quieres

Código:
<html>
<head>
<title>MSQL</title>

<script type="text/javascript">

function agregar(){

	var sel="", aa = document.form1.lista.options.selectedIndex, rec =  new Array();

	if(aa !=-1){
		for(i=0;i<document.form1.lista.options.length;i++){
			rec[i] = document.form1.lista.options[i].value;
			if(document.form1.lista.options[i].selected){
				document.form1.sel2.options[i] =  new Option(rec[i],rec[i]);
			}
		}
	}

	else
		alert("no hay opciones selecciondas");
}


function restar(){

	var sel="", aa = document.form1.sel2.options.selectedIndex, rec =  new Array();

	if(aa !=-1){
		for(i=0;i<document.form1.sel2.options.length;i++){
			rec[i] = document.form1.sel2.options[i].value;
			if(document.form1.sel2.options[i].selected){
				document.form1.sel2.options[i] =  new Option("","");
			}
		}
	}

	else
		alert("no hay opciones selecciondas");

}

</script>

</head>

<body>


<form name="form1">

<select multiple  size="5" name="lista">
<option value="OPCION 1">OPCION 1</option>
<option value="OPCION 2">OPCION 2</option>
<option value="OPCION 3">OPCION 3</option>
<option value="OPCION 4">OPCION 4</option>
<option value="OPCION 5">OPCION 5</option>
</select>


<select style="width:180px;height: 90px" size="5" name="sel2">
</select>

<input type="button" value="agregar  -->" onclick="agregar()" />
<input type="button" value="<--  restar" onclick="restar()" />

</form>

</body>
</html>
VER EJEMPLO