Ver Mensaje Individual
  #3 (permalink)  
Antiguo 18/10/2012, 21:41
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: Problema Java

A lo dicho por zerokilled agrego, "submit" no es un método válido, si tu form no hace un submit ni define un action, preferentemente utilizá onclick como evento
Esto sería algo más limpio
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2.    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4.     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  5. <title>Contacto</title>
  6. <link rel="stylesheet" href="../media/Formularios.css" type="text/css" />
  7. </head>
  8. <script type="text/javascript">
  9. //<![CDATA[
  10. function Comprobar(){
  11. var user=document.getElementById('nombre').value;
  12. var pass=document.getElementById('password').value;
  13.  
  14. if ((user=='2091923') && (pass=='123')){
  15. window.location.href = 'notas.html';
  16. }else if(user == "" || pass ==""){
  17. alert('por favor complete los campos');
  18. }else{
  19. alert('clave incorrecta');
  20. }
  21.  
  22. }
  23. //]]>
  24. <h1>Log in</h1>
  25. <form action="#">
  26. <label>Usuario <span class="small">Ingresa tu codigo</span></label>
  27. <input type="text" name="nombre" id="nombre"/>
  28. <label>Contraseña <span class="small">Ingresa tu contraseña</span></label>
  29. <input type="password" name="password" id="password" />
  30. <input type="button" onclick="Comprobar()" value="Entrar" /> <input type="reset" value="Borrar" />
  31. <div class="spacer"></div>
  32. </form>
  33. </body>
  34. </html>
Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.