Clickable dynamic row?

Discussion in 'jQuery' started by rob7676, Mar 8, 2012.

  1. #1
    Is there a way to make an entire row of a dynamic table clickable that will also get the url from a field supplied in the table?
     
    rob7676, Mar 8, 2012 IP
  2. Alex Roxon

    Alex Roxon Active Member

    Messages:
    424
    Likes Received:
    11
    Best Answers:
    7
    Trophy Points:
    80
    #2
    Yes it is, but you're question is too vague to receive an answer with any actual code :p

    Perhaps try elaborating exactly what you want?
     
    Alex Roxon, Mar 14, 2012 IP
  3. rob7676

    rob7676 Peon

    Messages:
    82
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I have a form that is used to search the database for pdf's, it generates the results into a table. One of the fields contains a link to view the pdf. I was hoping to make the entire row direct the user to the pdf on click.
     
    rob7676, Mar 15, 2012 IP
  4. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #4
    Completely possible - what you want though is to make the <tr> of the table clickable, which can be done using jQuery (you can't really wrap a table-row in an <a> as that is invalid HTML) - if you also make it so the text inside the tablerows aren't selectable, you'll get more or less what you want and need.

    $("tr").click(function() {
    //whatever you need done when clicking here
    });
     
    PoPSiCLe, Mar 27, 2012 IP