468,133 Members | 1,242 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,133 developers. It's quick & easy.

Question about Validation Controls

Joe
Hi,

I have a form with three text fields and a Submit button. The two text
fields have ReqiredFieldValidator and third text field has
RegularExpressionValidator. The page validation works fine in Internet
Explorer but I noticed that in FireFox, Netscape and Mozilla, they don’t
work.

These validation controls are set to run servside then why they don’t work
in non-IE browser.

Is there any workaround?

Thanks,

Joe

Nov 19 '05 #1
8 1067
=?Utf-8?B?Sm9l?= <Jo*@discussions.microsoft.com> wrote in
news:FB**********************************@microsof t.com:
These validation controls are set to run servside then why they don
Tt work in non-IE browser.


Did you implement the server side event handler for the validation
controls?
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
Horrible experience at Newmarket Volvo:
http://newmarketvolvo.tripod.com
Nov 19 '05 #2
Joe
Can you explain what you mean and how to do it?
Thanks
Joe


"Lucas Tam" wrote:
=?Utf-8?B?Sm9l?= <Jo*@discussions.microsoft.com> wrote in
news:FB**********************************@microsof t.com:
These validation controls are set to run servside then why they donƒ
Tt work in non-IE browser.


Did you implement the server side event handler for the validation
controls?
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
Horrible experience at Newmarket Volvo:
http://newmarketvolvo.tripod.com

Nov 19 '05 #3
Joe
MY form code as follows and it works fine in Internet Explorer but doesn't
work in non-IE browsers.

<form id="test" runat="server">
<table >
<tr>
<td><table>
<tr>
<td>*Required Field</td>
<td> </td>
</tr>
<tr>
<td>*First Name</td>
<td><asp:TextBox ID="FirstName" columns="25" runat="server" />
<asp:RequiredFieldValidator
id="RequiredFieldValidator1" runat="server"
ErrorMessage="Please enter your First name." Display="None"
ControlToValidate="FirstName" />
<asp:ValidationSummary id="ValidationSummary1"
ShowMessageBox="True" ShowSummary="False" runat="server"/>
</td>
</tr>
<tr>
<td>*Last Name</td>
<td><asp:TextBox id="LastName" columns="25" runat="server" />
<asp:RequiredFieldValidator
ID="RequiredFieldValidator2" runat="server"
ErrorMessage="Please enter your Last name." Display="None"
ControlToValidate="LastName" />
</td>
</tr>
<tr>
<td>*Email</td>
<td class="grey"><asp:TextBox id="txtEmail" columns="25"
runat="server" />
<asp:RequiredFieldValidator
ID="RequiredFieldValidator5" runat="server"
ErrorMessage="Please enter your Email address." Display="None"
ControlToValidate="Email" />
<asp:RegularExpressionValidator id="valValidEmail"
runat="server"
ControlToValidate="Email"

ValidationExpression="^([_a-zA-Z0-9-]+)(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+)(\.[a-zA-Z0-9-]+)*(\.[a-z]{2,4})$"
ErrorMessage="Invalid Email address."
Display="None">
</asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td></td>
<td><br /><asp:Button id="Submit" OnClick="submit" Text="Submit"
runat="server" />
</td>

</tr>
</table></td>
</tr>
</table>
</form>


"Lucas Tam" wrote:
=?Utf-8?B?Sm9l?= <Jo*@discussions.microsoft.com> wrote in
news:FB**********************************@microsof t.com:
These validation controls are set to run servside then why they donƒ
Tt work in non-IE browser.


Did you implement the server side event handler for the validation
controls?
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
Horrible experience at Newmarket Volvo:
http://newmarketvolvo.tripod.com

Nov 19 '05 #4
in the code behind in onload check Page.IsValid. referencing this property
run the serverside validation routines.

-- bruce (sqlwork.com)
"Joe" <Jo*@discussions.microsoft.com> wrote in message
news:94**********************************@microsof t.com...
MY form code as follows and it works fine in Internet Explorer but doesn't
work in non-IE browsers.

<form id="test" runat="server">
<table >
<tr>
<td><table>
<tr>
<td>*Required Field</td>
<td> </td>
</tr>
<tr>
<td>*First Name</td>
<td><asp:TextBox ID="FirstName" columns="25" runat="server" />
<asp:RequiredFieldValidator
id="RequiredFieldValidator1" runat="server"
ErrorMessage="Please enter your First name." Display="None"
ControlToValidate="FirstName" />
<asp:ValidationSummary id="ValidationSummary1"
ShowMessageBox="True" ShowSummary="False" runat="server"/>
</td>
</tr>
<tr>
<td>*Last Name</td>
<td><asp:TextBox id="LastName" columns="25" runat="server" />
<asp:RequiredFieldValidator
ID="RequiredFieldValidator2" runat="server"
ErrorMessage="Please enter your Last name." Display="None"
ControlToValidate="LastName" />
</td>
</tr>
<tr>
<td>*Email</td>
<td class="grey"><asp:TextBox id="txtEmail" columns="25"
runat="server" />
<asp:RequiredFieldValidator
ID="RequiredFieldValidator5" runat="server"
ErrorMessage="Please enter your Email address." Display="None"
ControlToValidate="Email" />
<asp:RegularExpressionValidator id="valValidEmail"
runat="server"
ControlToValidate="Email"

ValidationExpression="^([_a-zA-Z0-9-]+)(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+)(\.[a-zA-Z0-9-]+)*(\.[a-z]{2,4})$"
ErrorMessage="Invalid Email address."
Display="None">
</asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td></td>
<td><br /><asp:Button id="Submit" OnClick="submit" Text="Submit"
runat="server" />
</td>

</tr>
</table></td>
</tr>
</table>
</form>


"Lucas Tam" wrote:
=?Utf-8?B?Sm9l?= <Jo*@discussions.microsoft.com> wrote in
news:FB**********************************@microsof t.com:
> These validation controls are set to run servside then why they donf
> Tt work in non-IE browser.


Did you implement the server side event handler for the validation
controls?
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
Horrible experience at Newmarket Volvo:
http://newmarketvolvo.tripod.com

Nov 19 '05 #5
In VS.NET, you don't need to do anything to implement the server-side events
(unless you are using a Custom Validator).
"Lucas Tam" <RE********@rogers.com> wrote in message
news:Xn***************************@127.0.0.1...
=?Utf-8?B?Sm9l?= <Jo*@discussions.microsoft.com> wrote in
news:FB**********************************@microsof t.com:
These validation controls are set to run servside then why they donf
Tt work in non-IE browser.


Did you implement the server side event handler for the validation
controls?
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
Horrible experience at Newmarket Volvo:
http://newmarketvolvo.tripod.com

Nov 19 '05 #6
"Scott M." <s-***@nospam.nospam> wrote in
news:e7**************@TK2MSFTNGP15.phx.gbl:
In VS.NET, you don't need to do anything to implement the server-side
events (unless you are using a Custom Validator).


Just incase the guy was using a custom validator.

In anycase, to the OP - did you call Page.Validate?

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
Horrible experience at Newmarket Volvo:
http://newmarketvolvo.tripod.com
Nov 19 '05 #7
Hi Joe,

Let's get back to your original question. Yes, there is a way to get
client-side validation to work with non-IE browsers. ASP.NET 2.0 and my
Professional Validation And More (http://www.peterblum.com/vam/home.aspx)
are two solutions. For details on this issue and much more knowledge about
the Microsoft validators, see this article: www.aspalliance.com/699.

I also noticed that in your code, your ValidationSummary control has
ShowMessageBox=true and ShowSummary=false. The ShowMessageBox feature
requires client-side validation. On non-IE browsers, the ASP.NET 1.x
validators simply will not show anything for the ValidationSummary. So if
you want this to work, you will have to consider the alternatives (my
software, other third party controls, or ASP.NET 2.0).

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Joe" <Jo*@discussions.microsoft.com> wrote in message
news:FB**********************************@microsof t.com...
Hi,

I have a form with three text fields and a Submit button. The two text
fields have ReqiredFieldValidator and third text field has
RegularExpressionValidator. The page validation works fine in Internet
Explorer but I noticed that in FireFox, Netscape and Mozilla, they don't
work.

These validation controls are set to run servside then why they don't work
in non-IE browser.

Is there any workaround?

Thanks,

Joe

Nov 19 '05 #8
Joe
Thanks guys, I noticed that I wasn’t using Page.IsValid and then if the empty
form is submitted then I user can’t submit the form but because I am using
ShowMessageBox="True" ShowSummary="False" to display an alert pop-up window
in IE, how do I show a message to user in non-IE on postback?

Any clues and thanks for your great help.

joe
"Lucas Tam" wrote:
"Scott M." <s-***@nospam.nospam> wrote in
news:e7**************@TK2MSFTNGP15.phx.gbl:
In VS.NET, you don't need to do anything to implement the server-side
events (unless you are using a Custom Validator).


Just incase the guy was using a custom validator.

In anycase, to the OP - did you call Page.Validate?

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
Horrible experience at Newmarket Volvo:
http://newmarketvolvo.tripod.com

Nov 19 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Nedu N | last post: by
3 posts views Thread by Filippo | last post: by
6 posts views Thread by Stephen | last post: by
2 posts views Thread by Martyn Fewtrell | last post: by
5 posts views Thread by john.livermore | last post: by
6 posts views Thread by Bill44077 | last post: by
27 posts views Thread by didacticone | last post: by
1 post views Thread by gcdp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.