Ver Mensaje Individual
  #4 (permalink)  
Antiguo 31/08/2011, 15:50
Avatar de JeMaGa
JeMaGa
 
Fecha de Ingreso: julio-2011
Ubicación: Bogota
Mensajes: 430
Antigüedad: 12 años, 10 meses
Puntos: 4
Respuesta: problema al validar

mira es que he visto tutoriasles y no me funciona, esto es lo ultimo que he intentado y no funciona.

Código HTML:
Ver original
  1. <DOCTYPE html PUBLIC "- / / W3C / / DTD XHTML 1.0 Strict / / EN" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2.  
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
  4.  
  5.  
  6. <title>Crear Usuario</title>
  7.  
  8. </head>
  9.  
  10. <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
  11.  
  12. <link type="text/css" rel="stylesheet" href="estilo.css">
  13.  
  14. <script language="javaScript">
  15.  
  16. function  Validar(form1){
  17.     if(document.form1.Nombre.value =="")
  18.     {
  19.     alert("Ingrese Nombre ");
  20.     return false;
  21.     }
  22.     if (document.form1.Contrasena.value ==" ")
  23.     {
  24.     alert("Ingrese Contraseña");
  25.     return false;
  26.     }
  27.  
  28.     if(document.form1.Area.value ==" ")
  29.     {
  30.     alert("Ingrese Area");
  31.     return false;
  32.     }
  33.  
  34.     if(document.form1.Cargo.value ==" ")
  35.     {
  36.     alert("Ingrese Cargo");
  37.     return false;
  38.     }
  39. }
  40.  
  41.  
  42. <br>
  43.  
  44. <center><h2>INGRESO DE USUARIOS</h2></center>
  45.  
  46. <h3><center>Aqui se permite agregar usuarios, cuando sea necesario, todos los campos con un <font color="red"><b>*</b></font> son obligatorios</center></h3>
  47.  
  48. <center><form id="form1" action="InsertaUsuario.php" method="post" onsubmit="return Validar()">
  49.  
  50. <?php if (isset($sindatos)) echo $sindatos; ?>
  51.  
  52. <center><br><table border ='2'>
  53.  
  54. <tr>
  55.  
  56. <td>
  57.  
  58. <center><IMG SRC="imagenes/LOGO.jpg" WIDTH=120 HEIGHT=100></center>
  59.  
  60. <h3><center>USUARIO A INGRESAR</center></h3>
  61.  
  62. </td>
  63.  
  64. <td><br>
  65.  
  66. <center><h4><font color="red"><b>*</b></font> Nombre: <input type="text" name="Nombre" size="25" value="<?php if(isset($Nombre)) echo $Nombre ?>" /></h4></center>
  67.  
  68. <center><h4><font color="red"><b>*</b></font> Password: <input type="password" name="Contrasena" size="25" /></center></h4>
  69.  
  70. <center><h4><font color="red"><b>*</b></font> Area: <input type="text" name="Area" size="30" value="<?php if(isset($Area)) echo $Area ?>" /></center></h4>
  71.  
  72. <center><h4><font color="red"><b>*</b></font> Cargo: <input type="text" name="Cargo" size="29" value="<?php if(isset($Cargo)) echo $Cargo ?>" /></center></h4>
  73.  
  74. <p align="center"><input type="submit" value="AGREGAR"  name="Agregar"><br>
  75.  
  76. </td>
  77.  
  78. </tr>
  79.  
  80. <div align="center"><a href="MenuAdmi.php"><h3> Devlover </h3></a></div>
  81.  
  82.  
  83. </div>
  84.  
  85. </form></center>
  86.  
  87. </body>
  88.  
  89. </html>