how to access textboxes present in a table using javascript

S

sahithi

i have a table in which i have four textboxes which accepts input from
user,when submit button is clicked it has to be stored in database.can
any one suggest me how to get the textbox values present in a table
 
M

Martin Honnen

sahithi said:
i have a table in which i have four textboxes which accepts input from
user,when submit button is clicked it has to be stored in database.can
any one suggest me how to get the textbox values present in a table

If you have the table then you can use getElementsByTagName e.g.
table.getElementsByTagName("textarea")
gives you all textarea element in the table. If you are looking for
input type="text" elements then you need to use
table.getElementsByTagName("input")
and then iterate and check the type property being 'text'.
 
S

SAM

Le 9/17/09 2:13 PM, sahithi a écrit :
i have a table in which i have four textboxes which accepts input from
user,when submit button is clicked it has to be stored in database.can
any one suggest me how to get the textbox values present in a table


That isn't to do server side ?
see PHP, MySql, and so on to see how to set in a table of your database
the send values.

JavaScript has nothing to do with that
(I mean that has to work without JS)


<form action="toDataBase.php">
<table>
<tbody>
<tr>
<td>
<input name="Name" value="<?php echo $Name ?>" />
</td><td>
<input name="lastname" value="<?php echo $lastname ?>" />
</td>
.... etc.
</table>
</form>
 

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

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top