473,405 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Validators not working on Mozilla

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
4 4143
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
"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


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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: MonkeyBoy | last post by:
I am doing some some HTML manipulation in client-side script (IE5.x and IE6.x browsers only). Something like.. var tmpHTML = oTable.outerHTML // do something to the HTML her oTable.outerHTML =...
6
by: Mark | last post by:
We have Validators embedded in an asp table server control. The table server control is necessary and cannot be replaced. We want to apply CSS formatting to the validators, but the validators...
1
by: Shaun | last post by:
I am using a base page (I think they're also called master pages) as a base that my webforms inherit from. The base page controls formating and common functions used throughout the site. This all...
0
by: Ratman | last post by:
Regular Expression validators NOT working, Required Field validators ARE working I have tried everything from moving the aspnet_client folder around from root to web application, making it a...
0
by: interuser | last post by:
I have an existing large application that uses validators. I have a problem with the client side validators not working on netscape (and any browser other than IE). As you may already know, the...
1
by: Gabriel Lozano-Morán | last post by:
When using the tabstrip control combined with a multipage (several pageview) there is a problem when using validators. The problem is that validation also occurs on the validators that are not on...
2
by: Mike Surcouf | last post by:
Hi I have some regex validators on my page set to dynamic and like the way they appear after you tab out of a field and also when you try to postback the form. All OK so far When I register...
8
by: ShaneFowlkes | last post by:
For some reason, my validator controls stopped working when a form posts. They seems to work on fields that lose focus but if I submit a form with all empty fields, not of the required validators...
1
by: Andrew Jocelyn | last post by:
Hi I have a Formview control in a UserControl. The server-side validation is not working, i.e. the events are not firing when a button control which causes validation is fired or even when...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.