Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.57 KB | None | 0 0
  1. <html>
  2. <head>
  3. <script>
  4. window.onload = function () {
  5.     function validate() {
  6.         var fname = document.forms["signUp"]["fname"].value;
  7.         var sname = document.forms["signUp"]["sname"].value;
  8.        
  9.         if(fname == "" || sname == "") {
  10.             return false;
  11.         }
  12.     }
  13. }
  14. </script>
  15. </head>
  16.  
  17. <body>
  18.     <form name="signUp" action="http://naivist.net/form" method="GET" onsubmit="return validate()">
  19.         <div>
  20.             <label>Name</label>
  21.             <input type="text" name="fname">
  22.             <label>Surname</label>
  23.             <input type="text" name="sname">
  24.         </div>
  25.         <input type="submit">
  26.     </form>
  27. </body>
  28. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement