Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2008
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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 02:56 AM.

  • #2
    New to the CF scene
    Join Date
    Nov 2008
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •