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

Thread: table elements

  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    table elements

    I have a form named form1, inside which i have a table named table1, and that table1 has a column of text fields named result1, result2 etc.
    How do i access the value of those fields,
    i try doing this:

    document.form1.table1.result1.value and it doesn not work
    I also tried document.form1.getElementById('table1').result1.value and there too something is wrong.

    Could someone point out where I am going wrong.
    Thanks

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,966
    Thanks
    0
    Thanked 236 Times in 233 Posts
    document.form1.result1.value

    You may also use the bracket notation instead of dot notation. See my sig for more info.

    It doesn't matter if the fields are inside a table or not. Table is not part of the form control reference hierarchy.


  •  

    Posting Permissions

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