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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:36:40+00:00 2026-05-15T03:36:40+00:00

I am using the Jquery Validation plug-in, however i need to add a custom

  • 0

I am using the Jquery Validation plug-in, however i need to add a “custom rule”, i have 2 date fields and i need to ensure that the end date is not less than the start date. My problem is how to pass the two fields in as elements.

As i understand u set up a custom function something like this :

function customValidationMethod(value, element, params){  } 

But can’t see how i could use it with two fields, if anyone has any ideas it would be greatly appreciated.

  • 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-05-15T03:36:41+00:00Added an answer on May 15, 2026 at 3:36 am

    The validation plugin docs provide a writeup for this, here are the relevant parts:

    $.validator.addMethod("dateRange", function() {
      return new Date($("#fromDate").val()) < new Date($("#toDate").val());
    }, "Please specify a correct date range, the first must be before the second.");
    
    $("form").validate({
      //other rules, options, etc...
      groups: { dateRange: "fromDate toDate" } //show one error message, not two
    });
    

    Note that the custom method uses the IDs, the groups option uses the name attribute.

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

Sidebar

Related Questions

I'm using the jQuery Validation plug-in. I have overwritten the required rule since mine
I am using jQuery validation plug-in 1.7 for a page with form fields. The
I'm using jQuery along with the jQuery validation plug-in. I have a table where
I'm using: jQuery validation plug-in 1.6 * http://bassistance.de/jquery-plugins/jquery-plugin-validation/ with the latest version of jQuery.
Using the jQuery Validation plug-in for the following form: <form id=information method=post action=#> <fieldset>
Using jQuery validation plugin but it has no CSV validation. I have made an
I'm using the jQuery Validation plug-in is it possible to trow the errors in
I am using jQuery Validation and here is the extension that I am using
I have a mixed client-side/server-side validation using jQuery validation plugin. The validation happens on
I am using the jQuery Validation plug-in for a rather large form (the size

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.