Wrox Programmer Forums
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 30th, 2007, 04:30 AM
Authorized User
Join Date: Jun 2003
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Kabe
Default 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
Old May 1st, 2007, 05:00 AM
Friend of Wrox
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post


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
Old May 1st, 2007, 06:50 PM
Friend of Wrox
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41

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

Wind is your friend

Similar Threads
Thread Thread Starter Forum Replies Last Post
TD Color Change echovue Javascript How-To 1 March 3rd, 2006 03:40 AM
CSS for td. rupen CSS Cascading Style Sheets 2 September 6th, 2005 10:14 AM
MAX and MIN ON TD cleytonjordan XSLT 7 July 27th, 2005 12:39 PM
td abbr crmpicco HTML Code Clinic 6 June 14th, 2005 08:27 AM
LENGTH OF TD viren_balaut Javascript How-To 1 September 8th, 2004 08:43 AM

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