how do I access value of text field inside a table cell

Discussion in 'Javascript' started by Dom Nicholas, Oct 8, 2003.

  1. Dom Nicholas

    Dom Nicholas Guest

    Hi,

    I have a table (inside a form) that is dynamically created ie the user
    can add / remove rows dynamically. Each table row has 4 columns :

    a selection pull down list
    a text field for entering an amount
    a check box
    a button

    Note that the cell's and rows does not have a meaningful NAME tags ( the
    value is simply an incremented value each time a row is created ).

    When the user submits the form, I want to verify the supplied values. I
    want to loop over the each row and inspect the rows' cells contents.

    So for each row, I want to:

    - find out what was selected in the pulldown list
    - look at the amount given in the text field
    - see if the check box is

    How do I do this ? I can get to a cell, thetable.rows[0].cells[1] for
    example, but then I'm lost. I don't want to use innerHTML if possible.
    There must be a way to access the cell's content, access its assigned
    object and then get its value. I've seen firstChild.nodeType been used
    in places but (a) can't make sense of it cos I'm a novice at the DOM,
    and (b)have not been able to find what the nodeType's are , for example,
    what is type 3 and where can I find a reference of possible values/types
    ?

    ok thanks very much for any help on this.
    -Dom


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Dom Nicholas, Oct 8, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Phillip Roncoroni
    Replies:
    14
    Views:
    1,135
    Toby A Inkster
    Apr 5, 2004
  2. John Dalberg
    Replies:
    4
    Views:
    800
  3. sdf
    Replies:
    3
    Views:
    2,023
  4. VUNETdotUS
    Replies:
    25
    Views:
    514
    Thomas 'PointedEars' Lahn
    Nov 10, 2007
  5. jr
    Replies:
    3
    Views:
    492
Loading...

Share This Page