473,425 Members | 1,762 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,425 software developers and data experts.

Firefox Validation Issue - not the standard document.[all] problem!

I have a page that has some required field validators created in the
aspx, and other validators created in the Page_Load event.

In IE, all validation works as expected. In Firefox, ASPX validators
work fine, but the validators created in the code-behind do not.

Am I adding the validators to the wrong control on the page? Right now
I'm finding the main form control and adding them to that. Adding to
Page.Validators didn't work.

ASPX validators:

<asp:ValidationSummary ID="vlSummary" Runat="server" ShowSummary="True"
DisplayMode="BulletList" HeaderText="Please correct the following
error(s):" />

<asp:RequiredFieldValidator ID="vrqFirstName" Runat="server"
ControlToValidate="txtFirstName" ErrorMessage="First Name is required"
Display="None" />

<asp:RequiredFieldValidator ID="vrqLastName" Runat="server"
ControlToValidate="txtLastName" ErrorMessage="Last Name is required"
Display="None" />

<asp:RequiredFieldValidator ID="vrqAddress" Runat="server"
ControlToValidate="txtAddress" ErrorMessage="Address is required"
Display="None" />
Code-behind (called from Page_Load method):
private void AddReqFieldValidator(string fld, string msg_fld)
{
System.Web.UI.WebControls.RequiredFieldValidator rfv = new
System.Web.UI.WebControls.RequiredFieldValidator() ;
rfv.ID = "vrq" + fld;
rfv.ControlToValidate = fld;
rfv.ErrorMessage = msg_fld + " is required";
rfv.Display = ValidatorDisplay.None;
rfv.EnableClientScript = true;
Page.FindControl("frmPage").Controls.Add(rfv);
}

Nov 19 '05 #1
4 1413
client script validation is only supported for IE, for other browser, only
serverside validation works. for serverside validation to work, you must
call the IsValid property or the Validate() method in the codebehind.

-- bruce (sqlwork.com)
this requires your copdebehind
"andersoj" <je**********@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
I have a page that has some required field validators created in the
aspx, and other validators created in the Page_Load event.

In IE, all validation works as expected. In Firefox, ASPX validators
work fine, but the validators created in the code-behind do not.

Am I adding the validators to the wrong control on the page? Right now
I'm finding the main form control and adding them to that. Adding to
Page.Validators didn't work.

ASPX validators:

<asp:ValidationSummary ID="vlSummary" Runat="server" ShowSummary="True"
DisplayMode="BulletList" HeaderText="Please correct the following
error(s):" />

<asp:RequiredFieldValidator ID="vrqFirstName" Runat="server"
ControlToValidate="txtFirstName" ErrorMessage="First Name is required"
Display="None" />

<asp:RequiredFieldValidator ID="vrqLastName" Runat="server"
ControlToValidate="txtLastName" ErrorMessage="Last Name is required"
Display="None" />

<asp:RequiredFieldValidator ID="vrqAddress" Runat="server"
ControlToValidate="txtAddress" ErrorMessage="Address is required"
Display="None" />
Code-behind (called from Page_Load method):
private void AddReqFieldValidator(string fld, string msg_fld)
{
System.Web.UI.WebControls.RequiredFieldValidator rfv = new
System.Web.UI.WebControls.RequiredFieldValidator() ;
rfv.ID = "vrq" + fld;
rfv.ControlToValidate = fld;
rfv.ErrorMessage = msg_fld + " is required";
rfv.Display = ValidatorDisplay.None;
rfv.EnableClientScript = true;
Page.FindControl("frmPage").Controls.Add(rfv);
}

Nov 19 '05 #2
Then why do some of the client-side validators work in Firefox? I'd
buy that if none of them worked in Firefox at all.

Nov 19 '05 #3
Also, I AM calling the IsValid property in the codebehind.

Nov 19 '05 #4
TJS
I have found asp: validators to be unreliable with Firefox, in general,
regardless of codebehind.
That's even with browser detection and isvalid checks.

"andersoj" <je**********@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
I have a page that has some required field validators created in the
aspx, and other validators created in the Page_Load event.

In IE, all validation works as expected. In Firefox, ASPX validators
work fine, but the validators created in the code-behind do not.

Am I adding the validators to the wrong control on the page? Right now
I'm finding the main form control and adding them to that. Adding to
Page.Validators didn't work.

ASPX validators:

<asp:ValidationSummary ID="vlSummary" Runat="server" ShowSummary="True"
DisplayMode="BulletList" HeaderText="Please correct the following
error(s):" />

<asp:RequiredFieldValidator ID="vrqFirstName" Runat="server"
ControlToValidate="txtFirstName" ErrorMessage="First Name is required"
Display="None" />

<asp:RequiredFieldValidator ID="vrqLastName" Runat="server"
ControlToValidate="txtLastName" ErrorMessage="Last Name is required"
Display="None" />

<asp:RequiredFieldValidator ID="vrqAddress" Runat="server"
ControlToValidate="txtAddress" ErrorMessage="Address is required"
Display="None" />
Code-behind (called from Page_Load method):
private void AddReqFieldValidator(string fld, string msg_fld)
{
System.Web.UI.WebControls.RequiredFieldValidator rfv = new
System.Web.UI.WebControls.RequiredFieldValidator() ;
rfv.ID = "vrq" + fld;
rfv.ControlToValidate = fld;
rfv.ErrorMessage = msg_fld + " is required";
rfv.Display = ValidatorDisplay.None;
rfv.EnableClientScript = true;
Page.FindControl("frmPage").Controls.Add(rfv);
}

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dave Blair | last post by:
Hi, I have a problem with our intranet, we are planning to install Firefox instead of Internet Explorer onto some new PCs. However, we can't get the following JavaScript to work in Firefox and...
15
by: Dan | last post by:
Hi. I've got the following line of code which works fine in IE ... line_1_numbers = document.getElementsByTagName ('table').rows (0).cells (0).innerText; But it Firefox, it barks saying: ...
41
by: Gérard Talbot | last post by:
Cross-posted to: comp.infosystems.www.authoring.html and alt.html Followup-to: comp.infosystems.www.authoring.html 1- One day, I stumbled across a website that offers to validate webpages. What...
7
by: A.M | last post by:
Hi, I have a validation control in my page that upon any invalid data, it disables all buttons in the page. basicly i don't have any postback in the page if the validator finds any error. How...
3
by: TJS | last post by:
I am finding that the serverside requiredvalidator doesn't fire in the firefox browser, and user request proceeds through to my updateProfile method. Validation is working correctly in the IE...
45
by: Pat | last post by:
its seems asp.net validation doesn't fire when using FireFox? Tested a page and it doesn't fire. It seems the javascript doesn't fire Any ideas?
1
by: Hong Hao | last post by:
Recently, I was trying to modify an existing aspx page when client-side validation on that page stopped working. I searched this group and the web in general and found that other people have had...
2
by: sveinn | last post by:
Hi all, I've read through this group searching for an answear about this problem. Few have come close but not quite what I need. My problem is this: I'm using Ajax to fetch a new table with...
1
by: rjdougan | last post by:
I am not a developer but need some help with scripts for a client. I have a script to handle form validation and one that handle mouseover on menu. The form validation script works fine by it...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
isladogs
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.