Saludos
Me refiero al tag html <select>
este es mi codigo
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
function RellenaLista(formulario)
{
obj=document.getElementById('lstLista');
if (obj.selectedIndex==-1) return;
valor=obj.value;
txt=obj.options[obj.selectedIndex].text;
obj.options[obj.selectedIndex]=null;
obj2=document.getElementById('lstRecibe');
opc = new Option(txt,valor);
eval(obj2.options[obj2.options.length]=opc);
}
function BorraUnoLista(formulario)
{
obj=document.getElementById('lstRecibe');
if (obj.selectedIndex==-1) return;
valor=obj.value;
txt=obj.options[obj.selectedIndex].text;
obj.options[obj.selectedIndex]=null;
obj2=document.getElementById('lstLista');
opc = new Option(txt,valor);
eval(obj2.options[obj2.options.length]=opc);
}
</script>
</head>
<body>
<form name="form1" method="post" action="">
<table width="50%" align="center" >
<tr>
<td width="22%" rowspan="4">Producto</td>
<?php
include "conexion.php";
mssql_select_db("Bd") or
print "No se pudo conectar a la Base de datos";
$result = mssql_query("select usu_Cedula, usu_Nombres from Usuarioss order by usu_nombres",$conexion);
mssql_close($conexion);
?>
<td width="32%" rowspan="4"><select name="lstLista" size="6" id="lstLista">
<? $cont =0; while($row=mssql_fetch_array($result))
{
echo "<option value=".$row['usu_Cedula'].">".$row['usu_Nombres']."</option>";
$cont = $cont + 1;
}
?>
</select></td>
<td width="6%"><div align="center">
<input name="btnUnoAde" type="button" id="btnUnoAde" value=">" onClick="RellenaLista('form1');">
</div></td>
<td width="40%" rowspan="4"><select name="lstRecibe[]" size="6" id="lstRecibe">
</select>
<input type="button" name="Submit" value="Botón" onClick="form1.Accion.value='va';submit();">
<input name="Accion" type="hidden" id="Accion">
<input name="Valor" type="hidden" id="Valor"></td>
</tr>
<tr>
<td><div align="center">
<input name="btnUnoAtr" type="button" id="btnUnoAtr" value="<" onClick="BorraUnoLista('form1');">
</div></td>
</tr>
<tr>
<td><div align="center">
<input name="btnTodAde" type="button" id="btnTodAde" value=">>">
</div></td>
</tr>
<tr>
<td><div align="center">
<input name="btnTodAtr" type="button" id="btnTodAtr" value="<<">
</div></td>
</tr>
</table>
<input name="btnCont" type="button" id="btnCont" value="cont" onClick="contador()">
<script language="JavaScript">
function contador()
{
var num='<? echo $cont?>';
for(a=0;a<items.length;a++)
alert(num);
}
</script>
</form>
</body>
</html>
<?php
if($_POST['Accion']=='va')
{echo $cont;
$Var = $_GET['lstRecibe'];
foreach( $Var as $value)
{
echo "item".$value;
}
}
?>
Agradezco de antemano la ayuda que me prestas