Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to use RegularExpressionValidator instead of RequiredFieldValidator

Reply
Thread Tools

How to use RegularExpressionValidator instead of RequiredFieldValidator

 
 
Peter
Guest
Posts: n/a
 
      12-15-2003
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
 
Reply With Quote
 
 
 
 
Chris Jackson
Guest
Posts: n/a
 
      12-15-2003
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)
--

"Peter" <(E-Mail Removed)> wrote in message
news:04b701c3c343$ca66dd70$(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      12-17-2003
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)
>--
>
>"Peter" <(E-Mail Removed)> wrote in

message
>news:04b701c3c343$ca66dd70$(E-Mail Removed)...
>> 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

>
>
>.
>

 
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
Can I Use RequiredFieldValidator inside a repeater ? bhavesh ASP .Net Web Controls 3 01-19-2007 05:47 PM
howto use requiredfieldvalidator on a radiobuttongroup... =?Utf-8?B?SmFu?= ASP .Net 2 05-01-2006 08:42 AM
How to use RegularExpressionValidator to valid if a date ad ASP .Net 2 05-04-2005 12:02 AM
using RegularExpressionValidator and RequiredFieldValidator together???? Brian ASP .Net 2 04-15-2005 07:17 PM
How to make RequiredFieldValidator to use 2 inital values =?Utf-8?B?R1A=?= ASP .Net 0 03-03-2005 06:13 PM



Advertisments