Groups | Blog | Home
all groups > asp.net webcontrols > december 2006 >

asp.net webcontrols : Regular Expression Validator question


curious
12/24/2006 6:37:00 AM
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.
--
marss
12/25/2006 12:53:37 AM

[quoted text, click to view]

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."
AddThis Social Bookmark Button