Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Senior Member nocloset's Avatar
    Join Date
    Sep 2003
    Posts
    108
    Member #
    3228
    I have this HTML:

    <body onload="doLoad()">
    <form id="myform" name="myform">
    <table id="mytable" name="mytable">
    ......
    </table>
    </form>
    </body>

    <script language="javascript">
    function doLoad()
    {
    var mycells = mytable.rows[ 0 ].cells;
    ....
    }
    </script>

    I get a script error in Netscape, "mytable is not defined," giving the line number for the first line of the doLoad function.

    Any ideas what's wrong? Thanks!

  2.  

  3. #2
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    Use getElementById instead of the name.

    In Netscape it should be document.all.mytable.rows[0].cells IIRC for it to work, but use an id instead of the name and use...

    Code:
    document.getElementById('mytable').rows[0].cells
    Should work.
    JR

  4. #3
    Senior Member nocloset's Avatar
    Join Date
    Sep 2003
    Posts
    108
    Member #
    3228
    Thanks. I appreciate the help!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:56 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com