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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:21:52+00:00 2026-05-22T01:21:52+00:00

How can I specify a custom error message for each error type, like required

  • 0

How can I specify a custom error message for each error type, like required and date. I want a different message depending on the error type.

I have a field that looks like this

<input type="text" id="dateOfBirth" name="dateOfBirth" class="required date" />

my error messages look like this

This field is required or Please enter a valid date

How can I make it say the following

Date of birth is required and Please enter a valid date for Date of Birth

This is what I’m using

var validator = $("form:first").validate({
    errorClass: 'Input_State_Error',
    rules: {
        dateOfBirth: "required date"
    },
    messages: {
        dateOfBirth: "Please enter your date of birth"
    },
    // the errorPlacement has to take the table layout into account
    errorPlacement: function(error, element) {                
        error.appendTo($('#ctl00_lblMessage'));
    },
    // specifying a submitHandler prevents the default submit, good for the demo
    submitHandler: function() {
        alert("submitted!");
    },
    // set this class to error-labels to indicate valid fields
    success: function(label) {
        // set &nbsp; as text for IE
        label.html("&nbsp;").addClass("checked");
    }
});
  • 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-22T01:21:52+00:00Added an answer on May 22, 2026 at 1:21 am

    Following jquery date() documentation for Validation Plugin, i guess you suggest this:

    var validator = $("form:first").validate({
        ...
        messages: {
            dateOfBirth: {
                required: "Date of birth is required",
                date: "Please enter a valid date for Date of Birth"
            }
        }
        ...
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to have my users specify custom URL paths such that those
Is there any way I can specify a standard or custom numeric format string
I know I can specify one for each form, or for the root form
Using the WCF web programming model one can specify an operation contract like so:
I am currently trying to specify custom error messages in grails for the default
There's this cool new feature in SP 2010 where you can specify a custom
I define a custom PowerShell type with New-Object. I would like a parameter to
I want to require that one of my model classes specify my own custom
How can I use Same Custom Validation Attribute Multiple Times on Same Field or
I have created a custom content type that has a ReferenceField. When I set

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.