Regular Expression Validator - Server side validation is not working

C

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
 
H

Hans Kesting

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
 
C

CK

Hans Kesting said:
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
 
C

CK

Hans Kesting said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top