Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/03/2013, 16:00
drummerick7
 
Fecha de Ingreso: marzo-2013
Mensajes: 72
Antigüedad: 11 años, 1 mes
Puntos: 0
Busqueda Formulario con menu despleglable y BD

Hola que tal, pues soy nuevo en esto, aunque he visto varios temas por aquí.
Resulta que tengo un formulario y su respectivo script. (que muestro mas adelante)
Bueno ya me quebré la cabeza por dos días, y decidí pedir ayuda.
Ya funciona al desplegar el menú/lista, selecciona cualquiera de las dos opciones. al seleccionar 2 MAESTROS Y 1 AUXILIAR y se despliega tres campos de texto 2 para maestros y uno para auxiliar y también al seleccionar 2 MAESTROS Y 2 AUXILIAR, pero solo detecta la segunda opción y escribe en bd pero al seleccionar la primera opción y llenar los campos no escribe en BD ME PUEDEN AYUDAR

<tr valign="baseline">
<td align="right" nowrap="nowrap">&iquest;Qui&eacute;nimparti&oacute ; el Curso?</td>
<td valign="baseline">
<p>
<label for="selmaestros"></label>
<select name="selmaestros" id="selmaestros" onChange="selmaestro(this)">
<option value=""></option>
<option value="2MAESTROSY1AUXILIAR">2 MAESTROS Y 1 AUXILIAR</option>
<option value="2MAESTROSY2AUXILIAR">2 MAESTROS Y 2 AUXILIAR</option>
</select>
</p>
<div class="maestro1" style="display: none;">
<table width="105%" border="0">
<tr valign="baseline">
<td nowrap="nowrap" align="right"><label>Maestro 1:</label> </td>
<td><input name="quien_impartio_maestro1" type="text" value="" size="32"/></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"><label>Maestro 2:</label> </td>
<td><input name="quien_impartio_maestro2" type="text" value="" size="32"/></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"><label>Auxiliar 1:</label> </td>
<td><input name="quien_impartio_auxiliar1" type="text" value="" size="32"/></td>
</tr>
</table>
</div>
<div class="maestro1" style="display: none;">
<table width="105%" border="0">
<tr valign="baseline">
<td nowrap="nowrap" align="right"><label>Maestro 1:</label> </td>
<td><input name="quien_impartio_maestro1" type="text" value="" size="32"/></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"><label>Maestro 2:</label> </td>
<td><input name="quien_impartio_maestro2" type="text" value="" size="32"/></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"><label>Auxiliar 1:</label> </td>
<td><input name="quien_impartio_auxiliar1" type="text" value="" size="32"/></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"><label>Auxiliar 2:</label> </td>
<td><input name="quien_impartio_auxiliar2" type="text" value="" size="32"/></td>
</tr>
</table>
</div>
</td>
</tr>

OBVIO con su respectivo script que es:
<script>
function selmaestro(sel) {
if (sel.value=="2MAESTROSY1AUXILIAR"){
$(".maestro1").show();
$(".maestro2").hide();
}
else{
$(".maestro2").show();
$(".maestro1").hide();
}
}
</script>