Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-30-2008, 01:52 AM   PM User | #1
dmuellenberg
New to the CF scene

 
Join Date: Nov 2008
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
dmuellenberg is an unknown quantity at this point
getElementsByTagName and FireFox

I ran into a strange problem that only happens in Firefox but not IE. I am using getElementsByTagName to retrieve my 'input' fields in a function and then performing additional checks on each field with the following code:

Code:
var x=document.getElementsByTagName("input");
var i=0;
for (i=0;i<x.length;i++)
{
if (x[i].type=="radio")
The line that checks to see if the current element is a radio button terminates the function at that point, without any error messages. It appears that using x[i] doesn't work for some reason, since if I hard code it to x[0] then I don't get the error, but then I can only access the first element and I need to loop through and check all elements.

Anyone have any ideas why this doesn't work in FireFox (version 3.0.4)??

Daryl

Last edited by dmuellenberg; 11-30-2008 at 01:56 AM..
dmuellenberg is offline   Reply With Quote
Old 11-30-2008, 01:55 AM   PM User | #2
dmuellenberg
New to the CF scene

 
Join Date: Nov 2008
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
dmuellenberg is an unknown quantity at this point
Never mind - found my problem. There was some code later that was using x(i) instead of x[i] which was really causing the issue.
dmuellenberg is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:36 AM.


Advertisement
Log in to turn off these ads.