• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 499
  • Last Modified:

Override the default messages for the validation in jQuery plugin?

Hi Experts,  I am working on a asp.net page and trying to override the default error message of JQuery plugin "This field is required." to just "Required.".  Is it possible?  Thank you in advance.
0
RadhaKrishnaKiJaya
Asked:
RadhaKrishnaKiJaya
  • 3
  • 2
1 Solution
 
guru_samiCommented:
You can set the message like shown here by passing options.
http://docs.jquery.com/Plugins/Validation/validate#options
0
 
RadhaKrishnaKiJayaAuthor Commented:
Hi Guru Sami, could you plase point to the particular one.  There are so many and I did not find any one meeting my requirement.  Am I missing something?  Thank you Guru Sami again for your help.
0
 
guru_samiCommented:
my bad:
$(".selector").validate({
   rules: {
     name: "required",
     email: {
       required: true,
       email: true
     }
   },
   messages: {
     name: "Please specify your name",
     email: {
       required: "We need your email address to contact you",
       email: "Your email address must be in the format of name@domain.com"
     }
   }
})
another ref:
http://www.coldfusionjedi.com/index.cfm/2009/2/10/An-Introduction-to-jQuery-and-Form-Validation-2
0
 
RadhaKrishnaKiJayaAuthor Commented:
guru_sami solution worked partially for me.
0
 
RadhaKrishnaKiJayaAuthor Commented:
guru_sami solution worked partially for me.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now