Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7949213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:55:53+00:00 2026-06-04T01:55:53+00:00

I have a form with many fields which are displayed progressively. I need to

  • 0

I have a form with many fields which are displayed progressively. I need to check the fields to be OK before I show the next ones so I figured this out:

switch (index){
          case '1': 
              addRules1();
              break;
          case '2':
            addRules2();
            break;
          case '3':
              addRules3();
              break;
          }
          if ($("#contractForm").valid()){
//go to next group of inputs

The addRules functions look like this:

function addRules1(){
    $("#contractForm").validate({
        rules: {
        nom: {
           required: true,
           minlength: 2
         }
       },
       messages: {
           nom: {
           required: "the name!!",
           minlength: jQuery.format("At least {0} characters required!")
         }
       }        
    });                   
}
function addRules2(){

    $("#contractForm").validate({
        rules: {
        commune2: {
           required: true,
           minlength: 2
         }
       },
       messages: {
           commune2: {
           required: "the commune!!",
           minlength: jQuery.format("At least {0} characters required!")
         }
       }        
    }); 
}
function addRules3(){

    $("#contractForm").validate({
        rules: {
        addresseLivraison: {
           required: true,
           minlength: 2
         }
       },
       messages: {
           addresseLivraison: {
           required: "the addresse!!",
           minlength: jQuery.format("At least {0} characters required!")
         }
       }        
    });                                    
} 

For the first group everything is fine (on debugger also) but for the second one it just validates OK and moves on. Does the validator need to be reset or something? is there a easier way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T01:55:55+00:00Added an answer on June 4, 2026 at 1:55 am

    That is not how you would add and remove rules. As per the plugin’s documentation,

    .rules('add', {
            required: true,
            number: true
    });
    
    
    .rules('remove', {
            required: true,
            number: true
    });
    

    Note: you must call .validate() on the form before using either of those methods.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form which have many check boxes in it. User will check
I have a very large Form with many date fields that need to be
I am using asp.net/C# ,, i have a form with many fields ,,, it
I have a dynamic form that allow to add many fields dynamically, I Know
I have WPF Form which has many buttons with the same code. Appearance of
I have a form MainForm which is a Windows Forms form that contains many
I have a nested form in which I would like the form fields to
I have a form with many fields... The action is set to a php
I have a form with many many fields... When submitting these fields, I use
I have a form in which there are many textBoxes from which three textboxes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.