Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/01/2011, 01:43
DJJJ
 
Fecha de Ingreso: octubre-2005
Mensajes: 407
Antigüedad: 18 años, 7 meses
Puntos: 2
Respuesta: Llenar select desde un input text

prueba de esta forma

Código HTML:
<html>
<body>
<script language="JavaScript">
    function agregar(text) {
        var newOption = document.createElement('<option value='+text+'>');
        document.all.mySelect.options.add(newOption);
        newOption.innerText = text;
    }
    
</script>
<select id="mySelect">
    <option value="nombre">nombre</option>
    <option value="apellido">apellido</option>
    <option value="direccion">direccion</option>
</select>
<input type="text" name="text" id="text" value="juan">
<input type="button" value="agregar" onclick="agregar(text.value);">

</body>
</html>

saludos
__________________
DJJJ