By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,536 Members | 2,165 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,536 IT Pros & Developers. It's quick & easy.

Regular Expression Validator - Server side validation is not working

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
> 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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.