473,651 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:CustomVali dator id="vld1Payment Type"
ClientValidatio nFunction="Vali dateRadiobutton " runat="server"
ErrorMessage="P ayment Type must be selected"
CssClass="Valid ationMessage"></asp:CustomValid ator>

<script language="javas cript">
function ValidateRadiobu tton(oSrc, args) {
if(document.all["<%=rbChoiceA.C lientID%>"].checked == false &&
document.all["<%=rbChoiceB.C lientID%>"].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 1653
Hi John, the document.all collection is IE only so use
document.getEle mentById('<%= rbChoiceA.Clien tId%>')

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:CustomVali dator id="vld1Payment Type"
ClientValidatio nFunction="Vali dateRadiobutton " runat="server"
ErrorMessage="P ayment Type must be selected"
CssClass="Valid ationMessage"></asp:CustomValid ator>

<script language="javas cript">
function ValidateRadiobu tton(oSrc, args) {
if(document.all["<%=rbChoiceA.C lientID%>"].checked == false &&
document.all["<%=rbChoiceB.C lientID%>"].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 DisableBackButt on(oSrc, args) { window.history. forward(1); }

I tried changing the to the "getElementById " function.

function ValidateRadiobu tton(oSrc, args) {
if(document.get ElementById["<%=rbChoiceA.C lientID%>"].checked == false &&
document.getEle mentById["<%=rbChoiceB.C lientID%>"].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******** ********@TK2MSF TNGP14.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 DisableBackButt on(oSrc, args) { window.history. forward(1); }

I tried changing the to the "getElementById " function.

function ValidateRadiobu tton(oSrc, args) {
if(document.get ElementById["<%=rbChoiceA.C lientID%>"].checked == false &&
document.getEle mentById["<%=rbChoiceB.C lientID%>"].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******** ********@TK2MSF TNGP14.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.getEle mentById('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 DisableBackButt on(oSrc, args) { window.history. forward(1); }

I tried changing the to the "getElementById " function.

function ValidateRadiobu tton(oSrc, args) {
if(document.get ElementById["<%=rbChoiceA.C lientID%>"].checked == false &&
document.getEle mentById["<%=rbChoiceB.C lientID%>"].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******** ********@TK2MSF TNGP14.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
1011
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
1510
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
2922
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 Studio.NET 2003 and VB code behind. I have a radio button and textbox, and basically i need the textbox to be required based on the user selecting "Yes" from the radio button. I've read through the newsgroups and found that a Custom Validator
9
3133
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 lot of research in the areas of XHTML and WAI compliance, and am attempting to come up with a recommendation for our product in terms of standards level compliance. Ideally, I would like to be at XHTML 1.0 Strict. However, in my reading I have...
0
8275
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,...
0
8576
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6157
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 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...
0
5609
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4143
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
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
1
1906
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1585
bsmnconsultancy
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...

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.