| Author |
Getting the TD value using JavaScript + TD does not contain any ID.
|
Jigar Naik
Ranch Hand
Joined: Dec 12, 2006
Posts: 744
|
|
Hi,
I have below table
In the table there are 2 TD tags. The first tag contains the some text value which is number(111,222,333 as displayed in the table), and the second TD contains the checkbox. Now when i click on the checkbox checkboxClicked() function of java script gets called. Now i want to retrieve the value of corresponding first TD's value in the checkboxClicked function. like, when the user click on last checkbox checkboxClicked(3) will be called passing 3 as an argument. and in the checkboxClicked function i want to get the value 444. How do i achieve this ?
Is is possible ? can anybody help me out.
Below is my checkboxClicked function
This table is auto generated by some framework and i have only got the checkboxClicked function to get the data from table.
|
Jigar Naik
|
 |
vijin das
Ranch Hand
Joined: Jun 07, 2010
Posts: 129
|
|
TRY THIS
Even if you are dynamically generating teh values 111 2222 etc write the same value as the value property of the Hidden element ..
just give a try and test it ....
|
VIJINDAS
|
 |
Jigar Naik
Ranch Hand
Joined: Dec 12, 2006
Posts: 744
|
|
|
No actually the whole table is getting generated dynamically. so i can not change anything in the table. As i don't have access to the code which generate the table dynamically, its a framework. If i change the framework for my requirement so many other forms will give errors.
|
 |
vijin das
Ranch Hand
Joined: Jun 07, 2010
Posts: 129
|
|
Jigar Naik wrote:No actually the whole table is getting generated dynamically. so i can not change anything in the table.
ok then whether the values 111 222 333 444 are only there ..or will it change on any circumstances ?..
|
 |
Jigar Naik
Ranch Hand
Joined: Dec 12, 2006
Posts: 744
|
|
|
ya they will change whenever the page is loaded, basically they are coming from the database.
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15362
|
|
Eric
|
 |
Jigar Naik
Ranch Hand
Joined: Dec 12, 2006
Posts: 744
|
|
Thanks a lot Eric, it worked.
Thanks vijin
|
 |
 |
|
|
subject: Getting the TD value using JavaScript + TD does not contain any ID.
|
|
|