1

I'm trying to override the default jquery text for client validation in an MVC 3 project.

Obviously this looks like the right answer, but it's not working for me.

jQuery validation: change default error message

The error text specifically is also a bit different, it isn't

"This field is required."

It's "(DynamicFieldName) field is required." I want to change this, but I can't find it referenced anywhere. I've searched for all instances of required." in the entire project (as I assume that has to be defined client side somewhere for this to work, but maybe this text is being passed from the backend)

AH! I just found it, the validation text is being set as part of the html5 attribute validation things. Cool. Question solved.

I've checked the jQuery.validator.messages object, and my changes are being picked up.

Can anyone help!

Community
  • 1
  • 1
Chris Barry
  • 4,564
  • 7
  • 54
  • 89

1 Answers1

0

The value is being set as part of the html5 validation attributes. Needs to be changed from serverside in the model.

[Required(ErrorMessage="Required"]
Jarrod Dixon
  • 15,727
  • 9
  • 60
  • 72
Chris Barry
  • 4,564
  • 7
  • 54
  • 89