Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Check required field in custom validator

Reply
Thread Tools

Check required field in custom validator

 
 
Alex Shirley
Guest
Posts: n/a
 
      07-13-2004
Hi

I'm trying to check for a required field in a textbox using a custom
validator. I do not want to use a requiredfieldvalidator in this
instance.

I have tried the following code within the serverValidate handler and
it will not work:

If txtTheTextBox.Text.Trim <> "" Then
args.IsValid = True
else
args.IsValid = False
End If

.... and it refuses to work! Note serverValidate code does fire (I am
using other code as well in this custom validator and it works).
I don't think the blank string comparison is working.
Any ideas?

Thanks

Alex
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript validation for a not required field, field is onlyrequired if another field has a value jr Javascript 3 07-08-2010 10:33 AM
Required Field Validator Jim Heavey ASP .Net 0 11-14-2003 07:47 PM
Required field validator problem Do ASP .Net 3 10-23-2003 12:38 AM
Required Field Validator Client side popup Jinsong Liu ASP .Net 3 08-14-2003 07:53 PM
required field validator in Web custom control Sogescom ASP .Net Web Controls 2 07-08-2003 05:47 AM



Advertisments