/ Published in: PHP
URL: http://www.twitter.com/ldglucas
Ejemplo de como llenar un combobox o listbox con un for php, tomando los datos desde un Array. (TambiƩn puede ser desde MySQL, generando un array con el resultset de la consulta)
Expand |
Embed | Plain Text
<?php ); ?> <html> <header> <script> function onCambioDeOpcion(combobox) { alert("Seleccionaste: " + combobox[combobox.selectedIndex].text + " \nSu valor es: " + combobox.value); } </script> </header> <body> <select class="select_autor" name="autor" onchange="onCambioDeOpcion(this)" > <option selected="selected">Seleccione fabricante</option> <?php for($i=0; $i<count($data); $i++) { ?> <?php } ?> </select> </body> </html>
You need to login to post a comment.
