hola a todos tengo este script
Código HTML:
Ver original<?
session_start();
set_time_limit(0);
include("../inc/funciones.php");
include("../inc/oConn.php");
include("../inc/DesaWebPrueba.php");
?>
<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'));
}
}
<td valign="top">Tipo de Deporte:
<br /><br /><br />Integrantes:
</td>
<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){
?>
<option value="<?php echo $rsConn->fields[2];?>">
<?php echo $rsConn->fields[1];?>
</option> <?
$rsConn->MoveNext();
}
?>
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.-