Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Anchor tag for row in html table

 
Vivian Josh
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I am trying to implement following functionality for which I need some help.

1) When I click anywhere on the row in html table I need to open same page.
-> I tried putting <tr> inside <a> tag but its not working
2) I also want to send some hidden information eg. someID associated with each row.
-> I tried putting <INPUT type="HIDDEN"> but don't know whether its correct.

Can someone give me some hints on how to achieve this?

Thanks,
Vivian
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64623
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put an onclick handler on the <tr> and do whatever you want in the handler.
 
Vivian Josh
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
Put an onclick handler on the <tr> and do whatever you want in the handler.



Thanks Bear for this pointer

Is it correct to send "hidden" element in <tr> ?

eg:
<tr>
<inuput type="hidden" name="" value="">
</tr>
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64623
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hidden elements have nothing to do with <tr>'s but with forms. How are you planning to initiate the request to the server?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
 
Vivian Josh
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Thanks Eric ! Thats really wonderful work. I wanted to do just that !

- Vivian
 
Mark Stewart
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks i needed that too !
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic