rahul patil

rahul patil

  • NA
  • 160
  • 8.5k

how to call second page after the filled the input field?

May 15 2020 6:16 AM
I want to call signup javascript page after the user filled the form
 
Now I m facing 2 issue
 
when I filled only one input field and press next button then coming to the second page
 
when I filled all the input field and press the next button then not coming to the second page
 
signup.html
  1. <!DOCTYPE html>    
  2. <html>    
  3. <head>    
  4.     <meta charset="UTF-8" />    
  5.     <title></title>    
  6.     <script src="https://code.jquery.com/jquery-3.4.1.min.js" type="text/javascript"></script>    
  7.     <script type="text/javascript">    
  8.         function validatation() {    
  9.             debugger    
  10.             if ($("#txtfname").val() == "") {    
  11.                 debugger    
  12.                 alert("Provide a first name");    
  13.                 $("#txtfname").focus();    
  14.                 return false;    
  15.             }    
  16.             if ($("#txtmname").val() == "") {    
  17.                 debugger    
  18.                 alert("Provide a middle name");    
  19.                 $("#txtmname").focus();    
  20.                 return false;    
  21.             }    
  22.             if ($("#txtlname").val() == "") {    
  23.                 debugger    
  24.                 alert("Provide a last name");    
  25.                 $("#txtlname").focus();    
  26.                 return false;    
  27.             }    
  28.             return true;    
  29.         }    
  30.     </script>    
  31.     <script src="signup.js"></script>    
  32.  signup.js  
  33.    
  34. $(document).ready(function () {    
  35.     $('#btnnext').click(function (event) {    
  36.         sessionStorage.clear();    
  37.         sessionStorage.setItem("firstName", $("#txtfname").val());    
  38.         sessionStorage.setItem("lastName", $("#txtlname").val());    
  39.         sessionStorage.setItem("middleName", $("#txtmname").val());    
  40.         $("#txtPersonalInformation").load("ContactInformation.html");    
  41.     });    
  42. });    
what I want to
 
when user filled the all input field then I call to signup javascript
 
when user filled only one input field then not call to signup javascript
 
In short when user filled the form then calling to the next form 

Answers (2)