"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