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 8800509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:36:25+00:00 2026-06-14T00:36:25+00:00

I have the scenario like this: On a page there are two text boxes

  • 0

I have the scenario like this:

On a page there are two text boxes (FromDate and ToDate) which shows JQuery DatePicker onkeydown, and below these text boxes I have a submit button.

Once the page is loaded, I dont want these date text boxes to be validated against rules, but I want to ensure that JQuery Validator works for me on button click.

I have to fire validation at page load to ensure other rules are fired, like many other controls existing on page are validated once page is loaded.

One way I thought to add Rules on click of button, but seems Validator load them and hook them much earlier, so even if the same object is updated (with additional rules), it doesnt work.

Please help how it can be done? Thanks in advance.

  • 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-14T00:36:28+00:00Added an answer on June 14, 2026 at 12:36 am

    To handle this scenario, I removed the rules which were event based, from Page Load rules. I dynamically added/removed the rules. Code sample below:

    var Date1= {
            required: true,
            dateLesser: 'Date2',
            messages: {
                required: 'What ever',
                dateLesserThan: 'Date Should be less than'
            }
        };
    
    addDateValidationRules: function (d) {
        if (d== 2) {
            $('#Date1').rules("add", Date1);
            $('#Date2').rules("add", Date2);
        }
        else {
            $('#Date1').rules("remove", "required");
            $('#Date1').rules("remove", "dateLesser");
            $('#Date2').rules("remove", "required");
            $('#Date2').rules("remove", "dateGreater");
        }
    }
    

    Hope it helps somebody.

    Thanks.

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

Sidebar

Related Questions

the scenario is like this : datepicker jquery ui in french needs the page
There are two scenarios for an ASP.net webforms page which I would like to
I have a scenario like this: I need to pass @id to the stored
I have a scenario like this: form = MockRepository.GenerateMock<IAddAddressForm>(); mediator = new AddAddressMediator(form); The
I have a scenario that looks like this: #include <algorithm> using namespace std; //
If I have a simple cucumber feature and scenario , like this (example code
In a multithreaded scenario, I have a method like this: bool WaitForChange( time_duration WaitTime
I have this scenario where I would like to redirect my domains using the
I have the scenario like this, My environment is .Net2.0, VS 2008, Web Application
This might sound like an odd scenario, but I've got two forms on one

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.