Jquery Validate Plugin : Custom date format validation (mm/dd/yyyy)

Suppose, you are using Jquery Validator plugin to validate form fields and now you want to validate date field with custom format like mm/dd/yyyy or dd/mm/yyyy then there is no way to do by passing parameters.

Currently, Jquery Validator plugin is not allowing to define date format for validation.

In this case, you need to add one custom function and you need to write date format validation code in it and need to pass that function as parameter for that field in validate rule function.

See Example below :

        function(value, element) {
            return value.match(/^(0[1-9]|1[012])[\/|-](0[1-9]|[12][0-9]|3[01])[\/|-](19\d\d|2\d\d\d)$/);
        "Please enter a date in the format mm/dd/yyyy"


            rules: {
                dob: {
                    required : true,

You can change regular expression according to your requirement.

Chetan Patel

Chetan Patel is blogger, writes on Tech News, current trends, Gadgets Reviews, Website owner guide and Tips. You can connect him at Google+ & Facebook.

8 thoughts on “Jquery Validate Plugin : Custom date format validation (mm/dd/yyyy)

  • December 20, 2012 at 6:15 am

    I need detail clarification about the JQuery and how to validate the date format using JQuery.

  • December 20, 2012 at 6:46 am

    hieee..Need description about JQuery

  • December 26, 2012 at 12:03 pm

    need to know about Entity framework and how wite the queries in Entity framework and in LINQ to SQL

  • December 27, 2012 at 5:10 am

    jQuery is a lightweight, “write less, do more”, library.

    The purpose of jQuery is to make it much easier to use on your website.

    jQuery takes a lot of common tasks that requires many lines of code to accomplish, and wraps it into methods that you can call with a single line of code.

    jQuery also simplifies a lot of the complicated things from , like AJAX calls and DOM manipulation.

    The jQuery library contains the following features:

    HTML/DOM manipulation
    CSS manipulation
    HTML event methods
    Effects and animations

  • December 27, 2012 at 6:38 am

    hi this Reddy ,
    LINQ can be classified into 4 types :
    1.LINQ to object
    2.LINQ to sql
    3.LINQ to xml
    4.LINQ to entity [ADO.net Entity Framework]

    Deferred execution in LINQ is a way through which the queries can be executed at a later stage. In such an approach, an object is first defined that contains the query. This query runs only at a later stage. For example:

    var result = from reportcard in dbContext.Class5 where reportcard.studentname = ‘Pedro’; //This object result will execute later when used inside a foreach loop.

    Here, the query expression only defines the query. The object ‘result’ returns the actual result. During processing, Entity Framework lets the database do the actual processing by using the database routines. This makes it sure that the performance is at its best. Further, you may even create chained queries in LINQ where a query can query from another query. It is something like a nested statement.

  • December 27, 2012 at 6:40 am

    I hope this information may be useful for you ………
    if you any queries let me know


Leave a Reply

Your email address will not be published. Required fields are marked *