Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Regular Expression Validator question

Reply
Thread Tools

Regular Expression Validator question

 
 
curious
Guest
Posts: n/a
 
      12-24-2006
I am using a RegularExpressionValidator to validate a TextBox. I use
"^[\+|-]?[0-9]+(\.[0-9]*)?$" to check for a real number. The control works
fine as long as the user enters something in the TextBox; it does not work if
the user leaves the TextBox blank. Is there a bug in the implementation of
the RegularExpressionValidator? My regluar expression should also catch no
entry by the user.

Thanks.
--
ASP.NET fan.
 
Reply With Quote
 
 
 
 
marss
Guest
Posts: n/a
 
      12-25-2006

curious wrote:
> I am using a RegularExpressionValidator to validate a TextBox. I use
> "^[\+|-]?[0-9]+(\.[0-9]*)?$" to check for a real number. The control works
> fine as long as the user enters something in the TextBox; it does not work if
> the user leaves the TextBox blank. Is there a bug in the implementation of
> the RegularExpressionValidator? My regluar expression should also catch no
> entry by the user.
>
> Thanks.
> --
> ASP.NET fan.


MSDN: "Validation succeeds if the input control is empty. If a value is
required for the associated input control, use a RequiredFieldValidator
control in addition to the RegularExpressionValidator control."

 
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
Regular Expression Validator seems to be wrong! Edward ASP .Net 0 12-04-2003 05:31 PM
P.O. Box Regular Expression Validator - heeeeeelp? Simple Simon ASP .Net 2 11-04-2003 05:10 PM
Regular Expression Validator Bryce Budd ASP .Net 1 09-18-2003 05:51 PM
Dynamically changing the regular expression of Regular Expression validator VSK ASP .Net 2 08-24-2003 02:47 PM
Re: howto use c# regular expression validator to exclude file types Brian Vallelunga ASP .Net 2 07-31-2003 10:27 PM



Advertisments