• 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

get value on click from table using javascript

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please help get value on click from table using java script

I have a table generated from mysql query I have a code that highlight the row on the mouse click it the JavaScript but I also want to get the value of the cells from the row that is highlighted I tried doing different stuff but I always get an error value undefined.

Here is my code

in the JavaScript function I not only want to get the row highlighted but I also want to get the values of the cell in a row on mouse click



THANKS IN ADVANCE
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
first ting for a performance boost, you do not want to check for the body each time in the loop. Instead only grab the rows in the body to start with



If you have multiple tbodies, than you can add a loop there.

To get the values of the cells it would just be something like




Eric>
 
Alex gRin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks your suggestion worked fine but now I am face with different problem this code works fine


and I am trying to send it to another php/html page the problem is the JavaScript is not running everything else works fine
is there a way to do this

here is my ajax function which is on separate file specifically for calling files using ajax



is there a way to use this ajax to send the php function above with JavaScript working

Thanks in advance
and Thanks for all the support this site is providing while I work on this project
I would really appreciate any help I am new to web programming that may be the reason why I have so many questions.
 
Ranch Hand
Posts: 41
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try having a Another column and use hyper Link.


On that page create the query

Alex gRin wrote: Please help get value on click from table using java script

I have a table generated from mysql query I have a code that highlight the row on the mouse click it the JavaScript but I also want to get the value of the cells from the row that is highlighted I tried doing different stuff but I always get an  error value undefined.

Here is my code

in the JavaScript function I not only want to get the row highlighted but I also want to get the values of the cell in a row on mouse click



THANKS IN ADVANCE

 
Ifraz Imanudeen
Ranch Hand
Posts: 41
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
on

use


Ifraz Imanudeen wrote:Try having a Another column and use hyper Link.


On that page create the query



 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic