Search:
Namespaces
Discussions
.NET v1.1
Feedback
Is there a RegExp to require a value?
Messages
Related Types
This message was discovered on
ASPFriends.com 'aspngregexp' list
.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Marcie Jones (VIP)
Hi List,
I'm very new to Regular Expressions, so please excuse
me if I'm missing something very basic.
I'm using a RegExp validator control around an email
address textbox (works great), and I'm wondering if
there's a way to also specify in the RegExp that this
field is required. I'm just trying to avoid using
both a RegExp validator and a required field validator
on the same control--is this possible?
Thanks for any input!
Marcie
__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com
Reply to this message...
Wayne King
The validator controls are designed to be used together. That is, the =
solution *is* to use a
RegularExpressionValidator
and a =
RequiredFieldValidator
that are both validating the same textbox. If =
the textbox is empty, the
RegularExpressionValidator
isn't even =
activated. So, regardless of the ValidationExpression, there is no way =
to cause the RegExValidator to fail on empty input.
-----Original Message-----
From: Marcie Jones [mailto:
Click here to reveal e-mail address
]
Sent: Tuesday, October 16, 2001 6:59 AM
To: aspngregexp
Subject: [aspngregexp] Is there a RegExp to require a value?
Hi List,
I'm very new to Regular Expressions, so please excuse
me if I'm missing something very basic.
I'm using a RegExp validator control around an email
address textbox (works great), and I'm wondering if
there's a way to also specify in the RegExp that this
field is required. I'm just trying to avoid using
both a RegExp validator and a required field validator
on the same control--is this possible?
Thanks for any input!
Marcie
__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com
| [aspngregexp] member
Click here to reveal e-mail address
=3D YOUR ID
|
http://www.asplists.com/asplists/aspngregexp.asp
=3D JOIN/QUIT
|
http://www.asplists.com/search
=3D SEARCH Archives
Reply to this message...
Steven A Smith (VIP)
Yes, Wayne is correct. If you want to cut down on the number of controls
you need to put on the page, you might take a look at some free controls
I've been working on at
http://aspsmith.com
/vcontrols/" target="_blank">
http://aspsmith.com
/vcontrols/, including a control
called EmailBox that includes the textbox, the requiredfieldvalidator, and
the regexvalidator all in one control (and does mx record checking on top of
all that if you want it to).
Also, when you're looking for regex examples, or the ultimate email
validator, check out
http://regexlib.com
which has a bunch of expressions
(and add your own if they're not there).
Steve
Steven Smith
President, ASPAlliance.com
http://aspalliance.com
The #1 ASP.NET Community
http://aspsmith.com
ASP.NET Training for ASP Developers
Click here to reveal e-mail address
----- Original Message -----
From: "Wayne King" <
Click here to reveal e-mail address
>
To: "aspngregexp" <
Click here to reveal e-mail address
>
Sent: Tuesday, October 16, 2001 5:02 PM
Subject: [aspngregexp] RE: Is there a RegExp to require a value?
The validator controls are designed to be used together. That is, the
solution *is* to use a
RegularExpressionValidator
and a
RequiredFieldValidator
that are both validating the same textbox. If the
textbox is empty, the
RegularExpressionValidator
isn't even activated. So,
regardless of the ValidationExpression, there is no way to cause the
RegExValidator to fail on empty input.
-----Original Message-----
From: Marcie Jones [mailto:
Click here to reveal e-mail address
]
Sent: Tuesday, October 16, 2001 6:59 AM
To: aspngregexp
Subject: [aspngregexp] Is there a RegExp to require a value?
Hi List,
I'm very new to Regular Expressions, so please excuse
me if I'm missing something very basic.
I'm using a RegExp validator control around an email
address textbox (works great), and I'm wondering if
there's a way to also specify in the RegExp that this
field is required. I'm just trying to avoid using
both a RegExp validator and a required field validator
on the same control--is this possible?
Thanks for any input!
Marcie
__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com
| [aspngregexp] member
Click here to reveal e-mail address
= YOUR ID
|
http://www.asplists.com/asplists/aspngregexp.asp
= JOIN/QUIT
|
http://www.asplists.com/search
= SEARCH Archives
| [aspngregexp] member
Click here to reveal e-mail address
= YOUR ID
|
http://www.asplists.com/asplists/aspngregexp.asp
= JOIN/QUIT
|
http://www.asplists.com/search
= SEARCH Archives
Reply to this message...
System.Web.UI.WebControls.RegularExpressionValidator
System.Web.UI.WebControls.RequiredFieldValidator
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com