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

D

Dom Nicholas

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top