Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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???????

  • 1 month later...
Posted

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!

Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...