Foros del Web » Programando para Internet » Javascript »

Restrccion con el rut

Estas en el tema de Restrccion con el rut en el foro de Javascript en Foros del Web. HOLAAA...... ESTOY HACIENDO UN MANTENEDOR PARA UNA BIBLIOTECA.... TENGO UNA TABLA DE PRESTAMO DE LIBROS Y NECESITO VALIDAR.... LO QUE AGO ES QUE UN LIBRO ...
  #1 (permalink)  
Antiguo 05/07/2011, 21:11
 
Fecha de Ingreso: junio-2011
Mensajes: 26
Antigüedad: 12 años, 10 meses
Puntos: 0
Restrccion con el rut

HOLAAA......

ESTOY HACIENDO UN MANTENEDOR PARA UNA BIBLIOTECA.... TENGO UNA TABLA DE PRESTAMO DE LIBROS Y NECESITO VALIDAR....

LO QUE AGO ES QUE UN LIBRO SE LE PRESTE A UNA PERSONA PERO TIENE QUE SER MAXIMO 3 LIBROS ...... LO QUE QUIERO HACER ES ....

AL MOMENTO DE INGRESAR EL RUT ME PROCESE Y ME DIGA QUE ESTA PERSONA NO SE LE PUEDEN PRESTAR MAS DE 3 LIBROS O SI NO LLENAR EL FORMULARIO Y AL CUANDO ENVIO ME VALIDE QUE SI LA PERSONA SE HA LLEVADO MAS DE 3 LIBROS O NO......

LES DEJO EL FORMULARIO.....

Código HTML:
Ver original
  1. <table width="446" border="0" >
  2.           <form id="form1" name="form1" method="post" action="mant_prestamo.php?modo=5">
  3.                 <tr>
  4.                     <td width="123">Rut Cliente:</td>
  5.                     <td width="313"><input type="text" name="rut" size="40"></td>
  6.                 </tr>
  7.                 <tr>
  8.                     <td>Codigo Libro:</td>
  9.                     <td><input type="text" name="cod_libro" size="7"></td>
  10.                 </tr>
  11.                 <tr>
  12.                     <td>Fecha Inicio:</td>
  13.                     <td><input type="text" name="fecha_inicio" size="10"></td>
  14.                 </tr>
  15.                 <tr>
  16.                     <td>Fecha Entrega:</td>
  17.                     <td><input type="text" name="fecha_entre" size="10"></td>
  18.                 </tr>
  19.                 <tr>
  20.                     <td>Cod Status:</td>
  21.                     <td><input type="text" name="cod_status" size="7"></td>
  22.                 </tr>
  23.                 <tr>
  24.                     <td>Observacion:</td>
  25.                   <td><textarea name="observacion" cols="45" rows="6"></textarea></td>
  26.                 </tr>
  27.                 <tr>
  28.                     <td>Cod_Multa:</td>
  29.                     <td><input type="text" name="cod_Multa" size="7" /></td>
  30.                 </tr>
  31.                 <tr>
  32.                     <td>&nbsp;</td>
  33.                     <td align="center"><input name="registrar" type="submit" value="Registrar">&nbsp;<input type="reset" name="limpiar" value="Limpiar" /></td>
  34.                 </tr>
  35.           </form>
  36.         </table>
  #2 (permalink)  
Antiguo 06/07/2011, 00:49
Avatar de ceSharp  
Fecha de Ingreso: octubre-2008
Ubicación: Madrid
Mensajes: 495
Antigüedad: 15 años, 5 meses
Puntos: 66
Respuesta: Restrccion con el rut

hola ZebaA,

no sé si lo tendrás, pero tu control de libros necesita un poco de base de datos, no? si quieres controlar cuántos libros tiene un usuario con javascript no te va a valer, a no ser que nunca en la vida cierres tú página y nunca se pierda la sesión, jejejeje.
Javascript solo te vale para el momento, si de base de datos te viene el dato de cuántos libros tiene el usuario sí, se pueden poner unos alerts para advertir de que ya no puede coger más libros, pero si no hay dato que valga poco podemos hacer...

si tienes el dato de cuántos libros tiene el usuario vale, se puede hacer algo, pero si no está montado lo que te he explicado nada.

saludos.

Etiquetas: php, formulario
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta

SíEste tema le ha gustado a 1 personas




La zona horaria es GMT -6. Ahora son las 21:54.