asked 3 years ago viewed 1776 times active 3 years ago Related 1CustomValidator, pagemethods and JQuery what fun0Page.IsValid always returning true with ValidationGroup and dynamic CustomValidator14Dynamic error message for custom validator Currently I'm having to resort to an alert, but since all more other validation controls show their error messages on the page I'd like to continue this Here's an abridged version... Digging around, I find that the sender is not the span element, but is instead some other DOM object that doesn't display anything. The Rule of Thumb for Title Capitalization Why is every address in a micro-controller only 8 bits in size? get redirected here
When you set the errormessage on the sender in the client side validation function you are setting the equivalent of the ErrorMessage property. Here I have created a Regular Expression to validate decimals. It can be implemented in one of the following two ways: 1.
If the end user doesn't enter a phone number then it displays the first error. Join them; it only takes a minute: Sign up Dynamic error message for custom validator clientside up vote 14 down vote favorite 1 I am using a custom validator to call You may be able to access the span from the sender. Asp.net Custom Validator Client Side Dev centers Windows Office Visual Studio Microsoft Azure More...
sender.errorMessage is a property of the validator class. Asp.net Custom Validator Change Error Message Server Side jquery asp.net validation share|improve this question edited Mar 5 '13 at 13:05 asked Mar 5 '13 at 9:58 Farhad 75211 Does your JS execute at all. Figure 4: Error message when user don't writes invalid mobile number Conclusion This article showed two options to display an error message using a custom validator control. I guess I'll have to code up a test page and see if a simpler version doesn't act the way everyone seems to expect. –Dustman Aug 5 '09 at 19:45 add