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
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8" />
- <title></title>
- <script src="https://code.jquery.com/jquery-3.4.1.min.js" type="text/javascript"></script>
- <script type="text/javascript">
- function validatation() {
- debugger
- if ($("#txtfname").val() == "") {
- debugger
- alert("Provide a first name");
- $("#txtfname").focus();
- return false;
- }
- if ($("#txtmname").val() == "") {
- debugger
- alert("Provide a middle name");
- $("#txtmname").focus();
- return false;
- }
- if ($("#txtlname").val() == "") {
- debugger
- alert("Provide a last name");
- $("#txtlname").focus();
- return false;
- }
- return true;
- }
- </script>
- <script src="signup.js"></script>
- signup.js
-
- $(document).ready(function () {
- $('#btnnext').click(function (event) {
- sessionStorage.clear();
- sessionStorage.setItem("firstName", $("#txtfname").val());
- sessionStorage.setItem("lastName", $("#txtlname").val());
- sessionStorage.setItem("middleName", $("#txtmname").val());
- $("#txtPersonalInformation").load("ContactInformation.html");
- });
- });
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