• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting the TD value using JavaScript + TD does not contain any ID.

 
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 129
Firefox Browser Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ....

 
Jigar Naik
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 129
Firefox Browser Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ya they will change whenever the page is loaded, basically they are coming from the database.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



Eric
 
Jigar Naik
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Eric, it worked.



Thanks vijin
 
I'm so happy! And I wish to make this tiny ad happy too:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic