Código PHP:
Ver original
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Documento sin título</title> <script type="text/javascript"> function nombre() { var indice = document.form1.combo.selectedIndex var valor = document.form1.combo.options[indice].value document.getElementById('tipo').value = valor; } </script> </head> <body> <?php echo '<form name="form1" method="post" action="">'; echo '<select name="combo" id="combo" onChange="nombre()">'; echo '<option value="0">Seleccione </option>'; echo '<option value="' . $rows[1] . '" >' . $rows[1] . '</option>'; } echo '</select>'; echo '<input type="Submit" name="Submit" Value="Enviar" />'; echo '</form>'; ?> <input name='tipo' type='text' id='tipo' value='' size="40"> </body> </html>