How to use RegularExpressionValidator instead of RequiredFieldValidator

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
 
C

Chris Jackson

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.
 
G

Guest

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


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top