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

Custom field validators not firing in Firefox or Netscape

I'm currently testing doing some testing with other browsers and have found
that my custom field validators aren't firing with Firefox or Netscape, but
they work fine with Ie.

Here's the code I'm using:

<asp:CustomValidator id="vld1PaymentType"
ClientValidationFunction="ValidateRadiobutton" runat="server"
ErrorMessage="Payment Type must be selected"
CssClass="ValidationMessage"></asp:CustomValidator>

<script language="javascript">
function ValidateRadiobutton(oSrc, args) {
if(document.all["<%=rbChoiceA.ClientID%>"].checked == false &&
document.all["<%=rbChoiceB.ClientID%>"].checked == false){
args.IsValid = false;
}
}
</script>

Am I not going about this the right way or there another way to validate a
radio button?

Thanks!
Nov 19 '05 #1
5 1639
Hi John, the document.all collection is IE only so use
document.getElementById('<%= rbChoiceA.ClientId%>')

HTH jd

"John Abbler" wrote:
I'm currently testing doing some testing with other browsers and have found
that my custom field validators aren't firing with Firefox or Netscape, but
they work fine with Ie.

Here's the code I'm using:

<asp:CustomValidator id="vld1PaymentType"
ClientValidationFunction="ValidateRadiobutton" runat="server"
ErrorMessage="Payment Type must be selected"
CssClass="ValidationMessage"></asp:CustomValidator>

<script language="javascript">
function ValidateRadiobutton(oSrc, args) {
if(document.all["<%=rbChoiceA.ClientID%>"].checked == false &&
document.all["<%=rbChoiceB.ClientID%>"].checked == false){
args.IsValid = false;
}
}
</script>

Am I not going about this the right way or there another way to validate a
radio button?

Thanks!

Nov 19 '05 #2
John Abbler wrote:
I'm currently testing doing some testing with other browsers and have
found that my custom field validators aren't firing with Firefox or
Netscape, but they work fine with Ie.


Do other *client side* validator work? By default Firefox isn't recognised
as "up-level" browser, so no javascript is emitted.

See http://slingfive.com/pages/code/browserCaps/

Hans Kesting
Nov 19 '05 #3
Hi Hans,

Thanks for the reply. I have been using the BrowserCaps enhancement.

I also a Java Script function to disable the back button that does work.

function DisableBackButton(oSrc, args) { window.history.forward(1); }

I tried changing the to the "getElementById" function.

function ValidateRadiobutton(oSrc, args) {
if(document.getElementById["<%=rbChoiceA.ClientID%>"].checked == false &&
document.getElementById["<%=rbChoiceB.ClientID%>"].checked == false){
args.IsValid = false;
}
}

Unfortunately, it's still not working yet.

Any other suggestions?

Thanks!

"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
John Abbler wrote:
I'm currently testing doing some testing with other browsers and have
found that my custom field validators aren't firing with Firefox or
Netscape, but they work fine with Ie.


Do other *client side* validator work? By default Firefox isn't recognised
as "up-level" browser, so no javascript is emitted.

See http://slingfive.com/pages/code/browserCaps/

Hans Kesting

Nov 19 '05 #4
Firefox has tons of plugins that let you debug your client side code.
Actually, by default it has the JavaScript debugger. You just need to open
it up on your page and will tell you all of your errors.

--
Staff Consultant II
Enterprise Web Services
Cardinal Solutions Group

Future Business Model
Loan Origination Services
National City Mortgage
"John Abbler" wrote:
Hi Hans,

Thanks for the reply. I have been using the BrowserCaps enhancement.

I also a Java Script function to disable the back button that does work.

function DisableBackButton(oSrc, args) { window.history.forward(1); }

I tried changing the to the "getElementById" function.

function ValidateRadiobutton(oSrc, args) {
if(document.getElementById["<%=rbChoiceA.ClientID%>"].checked == false &&
document.getElementById["<%=rbChoiceB.ClientID%>"].checked == false){
args.IsValid = false;
}
}

Unfortunately, it's still not working yet.

Any other suggestions?

Thanks!

"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
John Abbler wrote:
I'm currently testing doing some testing with other browsers and have
found that my custom field validators aren't firing with Firefox or
Netscape, but they work fine with Ie.


Do other *client side* validator work? By default Firefox isn't recognised
as "up-level" browser, so no javascript is emitted.

See http://slingfive.com/pages/code/browserCaps/

Hans Kesting


Nov 19 '05 #5
Hi John document.getElementById('id') note curly brackets squarebrackets []
are indexers... HTH jd

"John Abbler" wrote:
Hi Hans,

Thanks for the reply. I have been using the BrowserCaps enhancement.

I also a Java Script function to disable the back button that does work.

function DisableBackButton(oSrc, args) { window.history.forward(1); }

I tried changing the to the "getElementById" function.

function ValidateRadiobutton(oSrc, args) {
if(document.getElementById["<%=rbChoiceA.ClientID%>"].checked == false &&
document.getElementById["<%=rbChoiceB.ClientID%>"].checked == false){
args.IsValid = false;
}
}

Unfortunately, it's still not working yet.

Any other suggestions?

Thanks!

"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
John Abbler wrote:
I'm currently testing doing some testing with other browsers and have
found that my custom field validators aren't firing with Firefox or
Netscape, but they work fine with Ie.


Do other *client side* validator work? By default Firefox isn't recognised
as "up-level" browser, so no javascript is emitted.

See http://slingfive.com/pages/code/browserCaps/

Hans Kesting


Nov 19 '05 #6

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

Similar topics

1
by: Jason | last post by:
I am able fire my field validators in FireFox on the server side using... Page.Validate() If Not Page.IsValid Then Exit Sub End If But the it won't fire Custom Validators. Anybody know why?
5
by: Jason | last post by:
I am able fire my field validators in FireFox on the server side using... Page.Validate() If Not Page.IsValid Then Exit Sub End If But the it won't fire Custom Validators. Anybody know why?
5
by: Mattyw | last post by:
Hi, I'm relatively new to Web Forms, I have been using Required Field Validators and Regular Expression Validators on a Web Form I am developing and everything works as expected using Visual...
9
by: wardy1975 | last post by:
Hi All, Looking for a little expert advice on a few web standards issues. I am currently trying to understand the impact of web standards for a web application I work with. I have been doing a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.