How to use RegularExpressionValidator instead of RequiredFieldValidator

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

Hi All,

I would want to use RegularExpressionValidator instead of
RequiredFieldValidator. I coded ValidationExpression="^[a-
zA-Z0-9 ]+$">. But it doesn't work. Do you have any idea?

Thanks,

Peter
 
A regular expression validator only fires if there are contents in the
control. If you need to validate against an expression, and you additional
require that the user inputs something, then you need to use both validator
controls.
 
Thanks Chris,
-----Original Message-----
A regular expression validator only fires if there are contents in the
control. If you need to validate against an expression, and you additional
require that the user inputs something, then you need to use both validator
controls.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

Hi All,

I would want to use RegularExpressionValidator instead of
RequiredFieldValidator. I coded ValidationExpression="^ [a-
zA-Z0-9 ]+$">. But it doesn't work. Do you have any idea?

Thanks,

Peter


.
 
Back
Top