Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/10/2003, 13:23
Bluesman74cl
 
Fecha de Ingreso: marzo-2003
Ubicación: onde toy?
Mensajes: 1.437
Antigüedad: 22 años, 2 meses
Puntos: 9
vamos por parte...de seguro vas a tener el siguiente problema...te lo digo por experiencia...recien salí de él...


primero debes insertar los valores a la base de datos y ese iba a ser el problema...

Pagina del formulario(iserta este código, es el formulario completo), claro está que puede haber una mejor maner de hacerlo.

<form action="inserta.asp" method="post" name="form2" onSubmit="MM_validateForm('dia','','RisNum','mes', '','RisNum','anio','','R');return document.MM_returnValue">
<table width="276">
<!--DWLayoutTable-->
<tr>
<td width="61" Class ="horas">Fecha:</td>
<td colspan="3"><input name="dia" class ="input" type="text" id="dia" value=<%=dia%> size="1" maxlength="0">
<font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><strong>/
<input name="mes" class ="input" type="text" id="mes" size="2" maxlength="0" value=<%=mes%>>
/
<input name="anio" class="input" type="text" id="anio" size="4" maxlength="0" value=<%=anno%>>
</strong></font></td>
</tr>
<tr>
<td width="61" class="horas"><input type="checkbox" class ="input" name="hora" value="08:00">08:00</td>
<td width="63" class="horas"><input type="checkbox" class ="input" name="hora" value="12:00">12:00</td>
<td width="66" class="horas"><input type="checkbox" class ="input" name="hora" value="16:00">16:00</td>
<td width="66" class="horas"><input type="checkbox" class ="input" name="hora" value="20:00">20:00</td>
</tr>
<tr>
<td width="61" class="horas"><input type="checkbox" class ="input" name="hora" value="08:30">08:30</td>
<td width="63" class="horas"><input type="checkbox" class ="input" name="hora" value="12:30">12:30</td>
<td width="66" class="horas"><input type="checkbox" class ="input" name="hora" value="16:30">16:30</td>
<td width="66" class="horas">&nbsp;</td>
</tr>
<tr>
<td width="61" class="horas"><input type="checkbox" class ="input" name="hora" value="09:00">09:00</td>
<td width="63" class="horas"><input type="checkbox" class ="input" name="hora" value="13:00">13:00</td>
<td width="66" class="horas"><input type="checkbox" class ="input" name="hora" value="17:00">17:00</td>
<td width="66" class="horas">&nbsp;</td>
</tr>
<tr>
<td width="61" class="horas"><input type="checkbox" class ="input" name="hora" value="09:30">09:30</td>
<td width="63" class="horas"><input type="checkbox" class ="input" name="hora" value="13:30">13:30</td>
<td width="66" class="horas"><input type="checkbox" class ="input" name="hora" value="17:30">17:30</td>
<td width="66" class="horas">&nbsp;</td>
</tr>
<tr>
<td width="61" class="horas"><input type="checkbox" class ="input" name="hora" value="10:00">10:00</td>
<td width="63" class="horas"><input type="checkbox" class ="input" name="hora" value="14:00">14:00</td>
<td width="66" class="horas"><input type="checkbox" class ="input" name="hora" value="18:00">18:00</td>
<td width="66" class="horas">&nbsp;</td>
</tr>
<tr>
<td width="61" class="horas"><input type="checkbox" class ="input" name="hora" value="10:30">10:30</td>
<td width="63" class="horas"><input type="checkbox" class ="input" name="hora" value="14:30">14:30</td>
<td width="66" class="horas"><input type="checkbox" class ="input" name="hora" value="18:30">19:30</td>
<td width="66" class="horas">&nbsp;</td>
</tr>
<tr>
<td width="61" class="horas"><input type="checkbox" class ="input" name="hora" value="11:00">11:00</td>
<td width="63" class="horas"><input type="checkbox" class ="input" name="hora" value="15:00">15:00</td>
<td width="66" class="horas"><input type="checkbox" class ="input" name="hora" value="19:00">19:00</td>
<td width="66" class="horas">&nbsp;</td>
</tr>
<tr>
<td width="61" class="horas"><input type="checkbox" class ="input" name="hora" value="11:30">11:30</td>
<td width="63" class="horas"><input type="checkbox" class ="input" name="hora" value="15:30">15:30</td>
<td width="66" class="horas"><input type="checkbox" class ="input" name="hora" value="19:30">19:30</td>
<td width="66" class="horas">&nbsp;</td>
</tr>
<tr>
<td colspan="4">&nbsp;</td>
</tr>
<tr>
<td colspan="4"><input name="enviar" type="submit" id="enviar" value="Enviar"></td>
</tr>
</table>
</form>



Página que recibe el form, que es donde insertas los valores en la base de datos: Esta es la que me quebró la cabeza y gracias a varios de acá logré terminar...


lo importante es esto....


horas = request.form("hora")

arrHoras = split(horas,",")

for i=0 to Ubound(arrHoras)
c = trim(arrHoras(i))
arrHoras(i) = c
next

for i = 0 to Ubound(arrHoras)
sql="Insert into Actividades (dia, mes, año, hora, usuario, estado, actividad, solicita) values ( '"& dia &"', '"& mes &"', '"& anno &"', '"& arrHoras(i) &"', '"& codusuario &"', '"& estado &"' , '"& actividad &"' , '"& solicita &"' )"
conexion.Execute(sql)

Next



espero te sirva...
__________________
Buena Vida...
Francisco