473,326 Members | 2,655 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Regular Expression Validator - Server side validation is not working

CK
Hello All,

I have a page with a text box. It has a required field validator, and a
regualur expression validator tied to it. A valid email is required. When
clientside is enabled it works great. When it's disabled the server side
validation works for the required field, but the server side doesn't work
for the regEx validator. Any ideas? Is it because two validators are tied to
the same control?

Thanks,
CK
May 11 '06 #1
3 5315
> Hello All,

I have a page with a text box. It has a required field validator, and a
regualur expression validator tied to it. A valid email is required. When
clientside is enabled it works great. When it's disabled the server side
validation works for the required field, but the server side doesn't work for
the regEx validator. Any ideas? Is it because two validators are tied to the
same control?

Thanks,
CK


It's not a problem to tie multiple validators to a single control.
How did you disable the requiredfieldvalidator? You *wanted* to
disabled only the client-side validation, but did you disable the
entire validator by mistake? Please show some code!

The validator *should* always work server-side, even if client-side is
enabled.

Hans Kesting
May 12 '06 #2
CK

"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:mn***********************@spamgourmet.com...
Hello All,

I have a page with a text box. It has a required field validator, and a
regualur expression validator tied to it. A valid email is required.
When clientside is enabled it works great. When it's disabled the server
side validation works for the required field, but the server side doesn't
work for the regEx validator. Any ideas? Is it because two validators are
tied to the same control?

Thanks,
CK


It's not a problem to tie multiple validators to a single control.
How did you disable the requiredfieldvalidator? You *wanted* to
disabled only the client-side validation, but did you disable the
entire validator by mistake? Please show some code!

The validator *should* always work server-side, even if client-side is
enabled.

Hans Kesting

<asp:TextBox ID="tbxUserName" Runat="server"
Width="200px"></asp:TextBox><br/>
<asp:RegularExpressionValidator
ID="rgExValUserName"
Runat="server"
ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
Display="Dynamic"
ControlToValidate="tbxUserName"
EnableClientScript="True"
ErrorMessage="Email Address is not properly formed"
Font-Size="9pt"
ForeColor="Red" />

<asp:RequiredFieldValidator
ID="reqValUserName"
Runat="server"
Display="Dynamic"
ControlToValidate="tbxUserName"
EnableClientScript="True"
ErrorMessage="Email is a required field"
Font-Size="9pt"
ForeColor="Red"/>

IE has a Dev Tool Bar. We are disabling client side script through there.
There required field validator still works as expected but the RegExpression
Validator fails to kick in. Any ideas?

Thanks,
CK

May 12 '06 #3
CK

"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:mn***********************@spamgourmet.com...
Hello All,

I have a page with a text box. It has a required field validator, and a
regualur expression validator tied to it. A valid email is required.
When clientside is enabled it works great. When it's disabled the server
side validation works for the required field, but the server side doesn't
work for the regEx validator. Any ideas? Is it because two validators are
tied to the same control?

Thanks,
CK


It's not a problem to tie multiple validators to a single control.
How did you disable the requiredfieldvalidator? You *wanted* to
disabled only the client-side validation, but did you disable the
entire validator by mistake? Please show some code!

The validator *should* always work server-side, even if client-side is
enabled.

Hans Kesting


<asp:TextBox ID="tbxUserName" Runat="server"
Width="200px"></asp:TextBox><br/>
<asp:RegularExpressionValidator
ID="rgExValUserName"
Runat="server"
ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
Display="Dynamic"
ControlToValidate="tbxUserName"
EnableClientScript="True"
ErrorMessage="Email Address is not properly formed"
Font-Size="9pt"
ForeColor="Red" />

<asp:RequiredFieldValidator
ID="reqValUserName"
Runat="server"
Display="Dynamic"
ControlToValidate="tbxUserName"
EnableClientScript="True"
ErrorMessage="Email is a required field"
Font-Size="9pt"
ForeColor="Red"/>

IE has a Dev Tool Bar. We are disabling client side script through there.
There required field validator still works as expected but the RegExpression
Validator fails to kick in. Any ideas?

Thanks,
CK



May 16 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Hernán Castelo | last post by:
should i to validate all the "Request"s calls like Request.FORM("...") and Request.Cookies("...") ???? if it is so, i have to see inside every "Input" elements like "Text" and even "Hidden"...
2
by: Bryce Budd | last post by:
Hi all, I am trying to use a regular expression validator to check for the existence of PO Box in an address textbox. The business rule is "No addresses with PO Boxes are allowed." What I...
2
by: S.Kartikeyan | last post by:
I have the following problem. I am using the follwing Regular Expression validator(REV) with validator expressions ^{1,2}$ ^{3,20}$ The idea of the first exp is 1 or 2 digits the idea of second...
2
by: Dot net work | last post by:
Hello. Say I have a .net textbox that uses a .net regularexpressionvalidator. If the regular expression fails, is it possible to launch a small client side javascript function to do something,...
9
by: AFN | last post by:
I was just dropped into someone else's code (isn't that always so fun?). I can't figure out why a custom validation control's server event function is executing. There is nothing (that I see)...
3
by: msnews.microsoft.com | last post by:
Hi All, I m facing problem in Server Side Validation. For Example The Scenario is I have two fields on the page 1 Country Dropdown List 2 Province Textbox 3 State Dropdown List
0
by: durga2005 | last post by:
hi i just added one textbox and regular expression validator in the form and set the properties for regular expression validator control. then i placed these two controls inside update panel ....
1
by: durga2005 | last post by:
hi i have a textbox and regular expression validator control .i have placed these control inside update panel. just im validating the textbox with regular expression validator control when i...
7
by: Igor | last post by:
I need to check some text box but if I put validation control than it is on client site and some user can change regular expression and make sql injection. I need to check this string at server...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.