Click here to Skip to main content
15,868,141 members
Home / Discussions / JavaScript
   

JavaScript

 
QuestionUsing XML Pin
V.28-Apr-19 20:57
professionalV.28-Apr-19 20:57 
SuggestionRe: Using XML Pin
Richard MacCutchan28-Apr-19 21:56
mveRichard MacCutchan28-Apr-19 21:56 
GeneralRe: Using XML Pin
V.28-Apr-19 22:21
professionalV.28-Apr-19 22:21 
GeneralRe: Using XML Pin
Richard MacCutchan28-Apr-19 22:25
mveRichard MacCutchan28-Apr-19 22:25 
GeneralRe: Using XML Pin
V.28-Apr-19 22:38
professionalV.28-Apr-19 22:38 
AnswerRe: Using XML Pin
Graham Breach29-Apr-19 2:35
Graham Breach29-Apr-19 2:35 
GeneralRe: Using XML Pin
V.30-Apr-19 1:38
professionalV.30-Apr-19 1:38 
Question<SOLVED> Why is my validation script not working? Pin
samflex26-Apr-19 4:20
samflex26-Apr-19 4: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 4:31
mveRichard Deeming26-Apr-19 4:31 
GeneralRe: Why is my validation script not working? Pin
samflex26-Apr-19 4:45
samflex26-Apr-19 4:45 
GeneralRe: Why is my validation script not working? Pin
Richard Deeming26-Apr-19 4:49
mveRichard Deeming26-Apr-19 4:49 
GeneralRe: Why is my validation script not working? Pin
samflex26-Apr-19 5:04
samflex26-Apr-19 5:04 
Questionjavascript Pin
Member 1418486021-Apr-19 23:48
Member 1418486021-Apr-19 23:48 
AnswerRe: javascript Pin
W Balboos, GHB15-May-19 4:08
W Balboos, GHB15-May-19 4:08 
AnswerRe: javascript Pin
Shraddha_Patel5-Nov-19 17:30
Shraddha_Patel5-Nov-19 17:30 
QuestionAdding Blank pages to PDF when requirements met Pin
Member 142140864-Apr-19 15:03
Member 142140864-Apr-19 15:03 
QuestionRe: Adding Blank pages to PDF when requirements met Pin
Richard MacCutchan4-Apr-19 17:57
mveRichard MacCutchan4-Apr-19 17:57 
AnswerRe: Adding Blank pages to PDF when requirements met Pin
Member 142140864-Apr-19 18:07
Member 142140864-Apr-19 18:07 
GeneralRe: Adding Blank pages to PDF when requirements met Pin
Richard MacCutchan5-Apr-19 5:10
mveRichard MacCutchan5-Apr-19 5:10 
Questionprint array json in dinamic table <html> Pin
serenimus29-Mar-19 11:15
serenimus29-Mar-19 11:15 
AnswerRe: print array json in dinamic table <html> Pin
Richard MacCutchan29-Mar-19 22:29
mveRichard MacCutchan29-Mar-19 22:29 
GeneralRe: print array json in dinamic table <html> Pin
serenimus29-Mar-19 22:50
serenimus29-Mar-19 22:50 
GeneralRe: print array json in dinamic table <html> Pin
Richard MacCutchan29-Mar-19 23:28
mveRichard MacCutchan29-Mar-19 23:28 
GeneralRe: print array json in dinamic table <html> Pin
serenimus30-Mar-19 8:27
serenimus30-Mar-19 8:27 
GeneralRe: print array json in dinamic table <html> Pin
Richard MacCutchan30-Mar-19 21:22
mveRichard MacCutchan30-Mar-19 21: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.