p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Javascript How-To (http://p2p.wrox.com/forumdisplay.php?f=87)
-   -   get INPUT value within TD (http://p2p.wrox.com/showthread.php?t=57280)

Kabe April 30th, 2007 04:30 AM

get INPUT value within TD
the html-code:
<tr><td>a</td><td>b</td><td><input type="text"></td></tr>
<tr><td>c</td><td>d</td><td><input type="text"/></td></tr>
<tr><td>e</td><td>f</td><td><input type="text"></td></tr>

i need only the value of td's in each tr-row when there's a value filled in in the input field.
suppose in first and last tr there's a value for 'input' i have to get this result: a:b:inputvalue|e:f:inputvalue|

where ':' is divider between rowvalues and '|' splitter between each row

iamrakesh22 May 1st, 2007 05:00 AM


while generating the table give ids to the tds, id value should be like rownumber_columnnumber or any other format so that you can identing tds uniquely and scan through all the tds.
Loop through the tds using javascript and use the childNodes attribute to get the input element reference, check the value of the input element if value is available append it to the string in the format you've mentioned.

Hope it gives a start to you.

- Rakesh

mat41 May 1st, 2007 06:50 PM

mmmmmm, the question and resone both confuse me...

Wind is your friend

All times are GMT -4. The time now is 05:40 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.