Código HTML:
Ver original
<? session_start(); set_time_limit(0); include("../inc/funciones.php"); include("../inc/oConn.php"); include("../inc/DesaWebPrueba.php"); ?> <html> <head> <script language="javascript">function crearText() { var actuales = document.getElementById('seccion'); var cant=actuales.childNodes.length; for(f=0;f<cant;f++) { actuales.removeChild(actuales.childNodes[0]); } var se = document.getElementById('seleccion'); var cantidad=0; for(f=0;f<se.value;f++) { cantidad++; var nuevohijo = document.createElement('input'); nuevohijo.type = 'text'; nuevohijo.name = 'deporte[]'; nuevohijo.id = 'nombre' + cantidad; document.getElementById('seccion').appendChild(nuevohijo); document.getElementById('seccion').appendChild(document.createElement('br')); } } </script> </head> <body> <tr> <td valign="top"> <select onChange="crearText()" id="seleccion"> <? $strSQL = "select id_deporte, INITCAP(deporte), integrantes from RESERVA_DEPORTE order by id_deporte asc"; $rsConn = $dbDesaP->Execute($strSQL) or die("Error"); while(!$rsConn->EOF){ ?> <? $rsConn->MoveNext(); } ?> </select> <br> <div id="seccion"> </div> <br> </td> </tr> </form> </body> </html>
necesito rescatar el id del deporte seleccionado, pero en el value tengo los integrantes para generar los textbox, como puedo hacer para recoger la id en una variable para guardarla en una tabla?
Saludos.-