Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/02/2011, 06:08
antuanbl
 
Fecha de Ingreso: octubre-2009
Mensajes: 16
Antigüedad: 14 años, 6 meses
Puntos: 0
SUBMIT para 3 combos anidados

Hola tengo un problema al hacer submit con un combo anidado /dinámico

El primer combo hace bien la consulta, los datos aparecen en el segundo, pero al seleccionarlo submite los datos y no llega a cargar el tercero.

Si quito action="facturar.php" llega al tercer box pero no submite nada.


Dejo el código por si alguien me puede ayudar, ya leí y releí en el foro y no he visto nada que me lo solucione

La idea es 3 combos anidados que al final hay que enviar el valor de los 3 combos al php que recoge los datos.



<p>
<form id="form1" name="form1" method="post" action="facturar.php">
<select name="nombre" id="nombre" onChange='submit()'>
<option value="" <?php if (!(strcmp("", $_POST['nombre']))) {echo "selected=\"selected\"";} ?>>nombre</option>
<?php
do {
?>
<option value="<?php echo $row_nombre['nombre']?>"<?php if (!(strcmp($row_nombre['nombre'], $_POST['nombre']))) {echo "selected=\"selected\"";} ?>><?php echo $row_nombre['nombre']?></option>
<?php
} while ($row_nombre = mysql_fetch_assoc($nombre));
$rows = mysql_num_rows($nombre);
if($rows > 0) {
mysql_data_seek($nombre, 0);
$row_nombre = mysql_fetch_assoc($nombre);
}
?>
</select>
<span id="edde">Si el cliente no aparece pulse en agregar</span>
<input type="button" value="Agregar Cliente" onclick="window.location='../taller/new_client.php'" />
</p>
<p>
<select name="matricula" id="matricula" onChange='submit()'>
<option value="" <?php if (!(strcmp("", $_POST['matricula']))) {echo "selected=\"selected\"";} ?>>matricula</option>
<?php
do {
?>
<option value="<?php echo $row_matricula['matricula']?>"<?php if (!(strcmp($row_matricula['matricula'], $_POST['matricula']))) {echo "selected=\"selected\"";} ?>><?php echo $row_matricula['matricula']?></option>
<?php
} while ($row_matricula = mysql_fetch_assoc($matricula));
$rows = mysql_num_rows($matricula);
if($rows > 0) {
mysql_data_seek($matricula, 0);
$row_matricula = mysql_fetch_assoc($matricula);
}
?>
</select>
</p>


<select name="modelo" id="modelo" onChange="submit()">
<option value="" <?php if (!(strcmp("", $_POST['modelo']))) {echo "selected=\"selected\"";} ?>>Modelo</option>
<?php
do {
?>
<option value="<?php echo $row_modelo['modelo']?>"<?php if (!(strcmp($row_modelo['modelo'], $_POST['modelo']))) {echo "selected=\"selected\"";} ?>><?php echo $row_modelo['modelo']?></option>
<?php
} while ($row_modelo = mysql_fetch_assoc($modelo));
$rows = mysql_num_rows($modelo);
if($rows > 0) {
mysql_data_seek($modelo, 0);
$row_modelo = mysql_fetch_assoc($modelo);
}
?>
</p>
<p>
</select>
</p>
<p>&nbsp;</p>
<p>
<input type="submit" name="form1" value="HACER FACTURA">