Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

custom validator

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
0
0
US
How would I make a validator to make sure a textbox is laid out: string, string
(two string separated by ", "

[conehead]
 
Any guidance on how to create a reg express to chec for ', '

[conehead]
 
something like this:

Code:
 <asp:RegularExpressionValidator id="RegularExpressionValidator1" runat="server"
            ControlToValidate="TextBox1"
            ValidationExpression="[red]you need to put your regular expression here[/red]"
            Display="Static">

-DNG
 
Hmmm I tried:

ValidationExpression="/\,\s/g"

And it does not validate anything - any ideas?

I want the textbox to have string, string

[conehead]
 
try this:

Code:
^[a-zA-Z][\w\.-]*[a-zA-Z0-9],[a-zA-Z][\w\.-]*[a-zA-Z0-9]

-DNG
 
I am not that good at regular expressions myself...so not sure if the above one works...after googlig for a bit i think you may need this:

^\s*[a-zA-Z,\s]+\s*$

try it out...

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top