Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > RegularExpressionValidator - check for empty field

Reply
Thread Tools

RegularExpressionValidator - check for empty field

 
 
Oleg Ogurok
Guest
Posts: n/a
 
      06-25-2003
Hi all,

I want to use RegularExpressionValidator to enforce non-empty integer format
in a TextBox. However, the validator doesn't give the error when the textbox
is empty. For example, if ValidationExpression is \d+ or even \d{1,}, the
validator still allows empty field. Must I use an additional
RequiredFieldValidator?

-Oleg.


 
Reply With Quote
 
 
 
 
William F. Robertson, Jr.
Guest
Posts: n/a
 
      06-25-2003
If a field is empty every validator (except RequiredFieldValidator) will not
be called.

If a field is required AND has an expected format, you will have to include
2 validators.

Or you can look at writing your own composite control that has both
validators inside it.

bill


"Oleg Ogurok" <(E-Mail Removed) m> wrote in
message news:(E-Mail Removed)...
> Hi all,
>
> I want to use RegularExpressionValidator to enforce non-empty integer

format
> in a TextBox. However, the validator doesn't give the error when the

textbox
> is empty. For example, if ValidationExpression is \d+ or even \d{1,}, the
> validator still allows empty field. Must I use an additional
> RequiredFieldValidator?
>
> -Oleg.
>
>



 
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
how to check the file field empty Rajkumar Surabhi Ruby 0 03-12-2010 12:16 PM
DetailsView ASP Control and an empty field not an empty record. ButlerDJIAM ASP .Net 0 11-09-2006 06:40 PM
Help developing a RegularexpressionValidator for a numeric field amazononthemoon ASP .Net Web Controls 1 05-26-2005 03:27 PM
ASP.NET RegularExpressionValidator - WhiteSpace versus "Empty" Shan Plourde ASP .Net 0 07-19-2004 03:06 PM
Check if a directory is empty and empty it Marcia Hon C Programming 8 02-14-2004 03:53 AM



Advertisments