Click here to Skip to main content
14,367,083 members

JavaScript

 
QuestionUsing XML Pin
V.28-Apr-19 21:57
professionalV.28-Apr-19 21:57 
SuggestionRe: Using XML Pin
Richard MacCutchan28-Apr-19 22:56
protectorRichard MacCutchan28-Apr-19 22:56 
GeneralRe: Using XML Pin
V.28-Apr-19 23:21
professionalV.28-Apr-19 23:21 
GeneralRe: Using XML Pin
Richard MacCutchan28-Apr-19 23:25
protectorRichard MacCutchan28-Apr-19 23:25 
GeneralRe: Using XML Pin
V.28-Apr-19 23:38
professionalV.28-Apr-19 23:38 
AnswerRe: Using XML Pin
Graham Breach29-Apr-19 3:35
memberGraham Breach29-Apr-19 3:35 
GeneralRe: Using XML Pin
V.30-Apr-19 2:38
professionalV.30-Apr-19 2:38 
Question<SOLVED> Why is my validation script not working? Pin
samflex26-Apr-19 5:20
membersamflex26-Apr-19 5:20 
Greetings experts.

I have used this script before on page with Next, Previous, Submit code and it worked then.

Now, I am trying to use it on a similar application where users will fill the first page and click Next to go to the next page.

Usually, if a required field is not completed and the user clicks Next, a message will display warning the user that a required field must be filled up with the message displaying next to that field.

With the script, you could click Next without completing a required field and it will go to the next page.

You could even click submit and your data will submit without being asked to complete required fields.

What am I doing wrong?

<script type="text/javascript">
     $(document).ready(function () {
         $("#msform").validate({
             rules: {
               certsel: "required",
               ssn1: "required",
               ssn2: "required",
               ssn3: "required",
               fname: "required",
               lname: "required",
               email: {
                   required: true,
                   email: true
                 },
               address: "required",
               city: "required",
               county: "required",
               state: "required",
               zip: "required",
               birthmon: "required",
               birthday: "required",
               birthyr: "required",
               ed: "required",
               ref1name: "required",
               ref1loc: "required",
               ref1title: "required",
               ref1area: "required",
               ref1pre: "required",
               ref1suff: "required",
               ref2name: "required",
               ref2loc: "required",
               ref2title: "required",
               ref2area: "required",
               ref2pre: "required",
               ref2suff: "required",
               ref3name: "required",
               ref3loc: "required",
               ref3title: "required",
               ref3area: "required",
               ref3pre: "required",
               ref3suff: "required",
               convictions: "required",
               txtCaptcha: "required",
               nmon: "required",
               nday: "required",
               nyr: "required",
               fullname: "required"
               }
           },
           messages: {
               //This section we need to place our custom validation message for each control.
               certsel: "Please select the position for which you're applyingd.",
                 ssn1: "Please enter your complete Social Security Number.",
                 ssn2: "Please enter phone number.",
                 ssn3: "Please enter your name.",
                 fname: "Please enter your first and last names.",
                 lname: "Please enter your first and last names.",
                 email: "Please enter your email address.",
                 address: "Please enter your complete Address, including city, state and zip code.",
                 city: "Please enter your complete Address, including city, state and zip code.",
                 county: "Please enter your complete Address, including city, state and zip code.",
                 state: "Please enter your complete Address, including city, state and zip code.",
                 zip: "Please enter your complete Address, including city, state and zip code.",
                 birthmon: "Please enter your birth month, day and year.",
                 birthday: "Please enter your birth month, day and year.",
                 birthyr: "Please enter your birth month, day and year.",
                 ed: "Please enter your highest level of education or if you have a GED.",
                 ref1name: "Please enter all information for refrence 1.",
                 ref1loc: "Please enter all information for refrence 1.",
                 ref1title: "Please enter all information for refrence 1.",
                 ref1area: "Please enter all information for refrence 1.",
                 ref1pre: "Please enter all information for refrence 1.",
                 ref1suff: "Please enter all information for refrence 1.",
                 ref2name: "Please enter all information for refrence 2.",
                 ref2loc: "Please enter all information for refrence 2.",
                 ref2title: "Please enter all information for refrence 2.",
                 ref2area: "Please enter all information for refrence 2.",
                 ref2pre: "Please enter all information for refrence 2.",
                 ref2suff: "Please enter all information for refrence 2.",
                 ref3name: "Please enter all information for refrence 3.",
                 ref3loc: "Please enter all information for refrence 3.",
                 ref3title: "Please enter all information for refrence 3.",
                 ref3area: "Please enter all information for refrence 3.",
                 ref3pre: "Please enter all information for refrence 3.",
                 ref3suff: "Please enter all information for refrence 3.",
                 convictions: "Please indicate whether you have had any convictions.",
                 txtCaptcha: "Please enter the code on above.",
                 nmon: "Please enter today's date and your full name in the space provided.",
                 nday: "Please enter today's date and your full name in the space provided.",
                 nyr: "Please enter today's date and your full name in the space provided.",
                 fullname: "Please enter today's date and your full name in the space provided."
                 }
            });
        });
  if ((!$('#msform').valid())) {
     return false;
 }
 </script>


modified 26-Apr-19 11:04am.

AnswerRe: Why is my validation script not working? Pin
Richard Deeming26-Apr-19 5:31
mveRichard Deeming26-Apr-19 5:31 
GeneralRe: Why is my validation script not working? Pin
samflex26-Apr-19 5:45
membersamflex26-Apr-19 5:45 
GeneralRe: Why is my validation script not working? Pin
Richard Deeming26-Apr-19 5:49
mveRichard Deeming26-Apr-19 5:49 
GeneralRe: Why is my validation script not working? Pin
samflex26-Apr-19 6:04
membersamflex26-Apr-19 6:04 
Questionjavascript Pin
Member 1418486022-Apr-19 0:48
memberMember 1418486022-Apr-19 0:48 
AnswerRe: javascript Pin
W Balboos15-May-19 5:08
mveW Balboos15-May-19 5:08 
AnswerRe: javascript Pin
Shraddha_Patel5-Nov-19 18:30
memberShraddha_Patel5-Nov-19 18:30 
QuestionAdding Blank pages to PDF when requirements met Pin
Member 142140864-Apr-19 16:03
memberMember 142140864-Apr-19 16:03 
QuestionRe: Adding Blank pages to PDF when requirements met Pin
Richard MacCutchan4-Apr-19 18:57
protectorRichard MacCutchan4-Apr-19 18:57 
AnswerRe: Adding Blank pages to PDF when requirements met Pin
Member 142140864-Apr-19 19:07
memberMember 142140864-Apr-19 19:07 
GeneralRe: Adding Blank pages to PDF when requirements met Pin
Richard MacCutchan5-Apr-19 6:10
protectorRichard MacCutchan5-Apr-19 6:10 
Questionprint array json in dinamic table <html> Pin
serenimus29-Mar-19 12:15
memberserenimus29-Mar-19 12:15 
AnswerRe: print array json in dinamic table <html> Pin
Richard MacCutchan29-Mar-19 23:29
protectorRichard MacCutchan29-Mar-19 23:29 
GeneralRe: print array json in dinamic table <html> Pin
serenimus29-Mar-19 23:50
memberserenimus29-Mar-19 23:50 
GeneralRe: print array json in dinamic table <html> Pin
Richard MacCutchan30-Mar-19 0:28
protectorRichard MacCutchan30-Mar-19 0:28 
GeneralRe: print array json in dinamic table <html> Pin
serenimus30-Mar-19 9:27
memberserenimus30-Mar-19 9:27 
GeneralRe: print array json in dinamic table <html> Pin
Richard MacCutchan30-Mar-19 22:22
protectorRichard MacCutchan30-Mar-19 22:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.