Advertisement
Guest User

Untitled

a guest
Jan 11th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <head>
  2. <script>
  3. function myFunction()
  4. {
  5. var a=document.forms["login"]["uname"].value;
  6. var b=document.forms["login"]["pwd"].value;
  7. if(a=="" || b =="")
  8. {
  9. error="All fields must be entered.";
  10. document.getElementById("errorid").innerHTML=error;
  11. }
  12. }
  13. </script>
  14. </head>
  15. <body>
  16. <form name="login" action="">
  17. <b>Enter username:</b>
  18. <input type="text" name="uname" /><br />
  19. <b>Enter password:</b>
  20. <input type="password" name="pwd" /><br />
  21. <p id="errorid"></p>
  22. <input onclick="myFunction()" type="submit" />
  23. </form>
  24. </body>
  25.  
  26. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement