I have a RegularExpressi onValidator 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:RegularExp ressionValidato r ID="Years"
ControlToValida te="YearsComple te" Display="Dynami c"
ErrorMessage="< br>Not a valid number"
ValidationExpre ssion="(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 4 4159
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**********@f tsolutions.comw rote in message
news:e5******** ******@TK2MSFTN GP03.phx.gbl...
>I have a RegularExpressi onValidator 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:RegularExp ressionValidato r ID="Years"
ControlToValida te="YearsComple te" Display="Dynami c"
ErrorMessage="< br>Not a valid number"
ValidationExpre ssion="(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
"Teemu Keiski" <jo****@aspalli ance.comwrote in message
news:eE******** ******@TK2MSFTN GP06.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**********@f tsolutions.comw rote in message
news:e5******** ******@TK2MSFTN GP03.phx.gbl...
>>I have a RegularExpressi onValidator 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:RegularExp ressionValidato r ID="Years" ControlToValid ate="YearsCompl ete" Display="Dynami c" ErrorMessage="< br>Not a valid number" ValidationExpr ession="(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
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/
"Martin Honnen" <ma*******@yaho o.dewrote in message
news:O0******** ********@TK2MSF TNGP02.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/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 = tmpHTML
Before the changes, client-side .Net field validators (RegularExpressionValidator, RangeValidator, etc.) work fine... after the changes, the modified HTML works correctly but the validators stop functioning. Seems that the onchange handler...
|
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 have a default RED font
that appears to be difficult to remove. We could hard code in a blank font
color into the .aspx html for each validator, but that would defeat the
purpose of the CSS.
Is there a way to change the default RED color of...
|
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 works great
until I want to use a validator.
Any validators added to the page do not fire. I can leave a required
textbox blank, and the code happily chugs through processing the
button click code.
After some research, I've found that some...
|
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 virtual directory, not
making it a virtual directory. I am at a loss. I even uninstalled
framework, reinstalled 1.0, then sp3, then 1.1, then sp1. Still no
go. My code is simple, it used to work, the only thing I can think
that I did since it has...
|
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
reason is that the validators use document.all which is regognized
only by IE's javascript (as opposed to document.getElementById() which
is regognized by all browsers.)
I do not want to use validators other than dotnet's (it's the standard
of...
| |
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 the currently selected
pageview of the multipage. To prevent this from happening I disable all the
validators and only enable the validators on the selected page but does not
look to me like the correct way of working.
Is there a better way to...
|
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 for the client side event of a textbox using ...
textBox.Attributes.Add("onKeyUp","javascriptfunction");
|
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 catch it and this results in
runtime errors with my code.
It's real standard stuff using .NET 2 (VB). I've stopped and restarted IIS
several times and I even re-registered the NET service using this at the
command prompt:...
|
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 Page.Validate() is explicitly
called.
I'm loading the FormView as an IBindableTemplate as in this article but I
don't think this is the reason for the validation not working.
http://www.developerfusion.co.uk/show/4721/
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |