derekzelazny Posted October 21, 2003 Posted October 21, 2003 I have crated a custom validator control with client side function to check my ASP:TextBox control for empty spaces (I could not use required field validator -- do not ask why). My issue is that the my client side function is not called when controlled field is empty, but only when it has a value in it. I was able to trace the problem to CustomValidatorEvaluateIsValid function (which is rendered by ASP.NET automatically), which function checks for teh length of the the text in the controlled TextBox and if it is blank returns true without calling cutom client side function. How can I force to call my custom client side function when the TextBox value is blank??????? Quote
Muhad Posted December 13, 2003 Posted December 13, 2003 I have been able to use the RequiredFieldValidator successfully. You only have to set two properties, ControlToValidate and ErrorMessage; other settings are at default and I only added some color settings. This control should work for you! Quote
Administrators PlausiblyDamp Posted December 13, 2003 Administrators Posted December 13, 2003 By design the only validator that checks for the presence of data is the required field validator. Is there any reason why you couldn't use the required field validator alongside your custom validator? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Muhad Posted December 13, 2003 Posted December 13, 2003 By design the only validator that checks for the presence of data is the required field validator. Is there any reason why you couldn't use the required field validator alongside your custom validator? I am trying to use both on the same field. I have seen examples of validator classes but I can't get them to work yet. I am new to vs.net. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.