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

Validators not working on Mozilla

P: n/a
I have a RegularExpressionValidator that is testing a field to make sure the
number is between 0 and 255. It works fine in IE, but doesn't work in
Mozilla or Firefox.

<asp:RegularExpressionValidator ID="Years"
ControlToValidate="YearsComplete" Display="Dynamic"
ErrorMessage="<br>Not a valid number"
ValidationExpression="(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
Runat="server"/>

Why doesn't it work?

Does this mean none of my Validators are working for these Browsers?

Thanks,

Tom
Aug 25 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Using ASP.NET 1 or 2? Note that despite having validators control on the
page, you need to check Page.IsValid always before any critical code runs,
to do server-side validation check (in case you run custom code within
button's click etc)

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"tshad" <ts**********@ftsolutions.comwrote in message
news:e5**************@TK2MSFTNGP03.phx.gbl...
>I have a RegularExpressionValidator that is testing a field to make sure
the number is between 0 and 255. It works fine in IE, but doesn't work in
Mozilla or Firefox.

<asp:RegularExpressionValidator ID="Years"
ControlToValidate="YearsComplete" Display="Dynamic"
ErrorMessage="<br>Not a valid number"
ValidationExpression="(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
Runat="server"/>

Why doesn't it work?

Does this mean none of my Validators are working for these Browsers?

Thanks,

Tom

Aug 25 '06 #2

P: n/a
"Teemu Keiski" <jo****@aspalliance.comwrote in message
news:eE**************@TK2MSFTNGP06.phx.gbl...
Using ASP.NET 1 or 2? Note that despite having validators control on the
page, you need to check Page.IsValid always before any critical code runs,
to do server-side validation check (in case you run custom code within
button's click etc)
I am using ASP.Net 1.1.

The problem is that it is working fine in IE. As I tab out of the field,
the error is caught and message displayed. But not in the other browsers.

Thanks,

Tom
>
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"tshad" <ts**********@ftsolutions.comwrote in message
news:e5**************@TK2MSFTNGP03.phx.gbl...
>>I have a RegularExpressionValidator that is testing a field to make sure
the number is between 0 and 255. It works fine in IE, but doesn't work in
Mozilla or Firefox.

<asp:RegularExpressionValidator ID="Years"
ControlToValidate="YearsComplete" Display="Dynamic"
ErrorMessage="<br>Not a valid number"
ValidationExpression="(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
Runat="server"/>

Why doesn't it work?

Does this mean none of my Validators are working for these Browsers?

Thanks,

Tom


Aug 25 '06 #3

P: n/a


tshad wrote:

I am using ASP.Net 1.1.

The problem is that it is working fine in IE. As I tab out of the field,
the error is caught and message displayed. But not in the other browsers.
If validation happens when you tab out of the field then I am pretty
sure that validation is done with client-side script ASP.NET has
generated. And ASP.NET 1.1 usually generates client-side script geared
towards IE 4 and later using the IE DOM and not the more cross browser
compatible W3C DOM, therefore with the normal settings browsers like
Mozilla will not get that client-side script at all. Server-side
validation on postback should nevertheless work independent of the
browser and any client-side script ASP.NET might or might not generate.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Aug 25 '06 #4

P: n/a
"Martin Honnen" <ma*******@yahoo.dewrote in message
news:O0****************@TK2MSFTNGP02.phx.gbl...
>

tshad wrote:

>I am using ASP.Net 1.1.

The problem is that it is working fine in IE. As I tab out of the field,
the error is caught and message displayed. But not in the other
browsers.

If validation happens when you tab out of the field then I am pretty sure
that validation is done with client-side script ASP.NET has generated. And
ASP.NET 1.1 usually generates client-side script geared towards IE 4 and
later using the IE DOM and not the more cross browser compatible W3C DOM,
therefore with the normal settings browsers like Mozilla will not get that
client-side script at all. Server-side validation on postback should
nevertheless work independent of the browser and any client-side script
ASP.NET might or might not generate.
That was what I figured and as soon as I added the test for IsValid, it
seems to work fine.

Thanks,

Tom
>
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Aug 25 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.