title: Use a TR as a form submit button rather than a button that says edit
body: <p>I have a PHP page that generates a list of truck loads and I want to get rid of the Edit button and instead make it so when you click on the TR it submits the form for edit.</p>
  
  <p><strong>So far I have found an option similer that submits to a specified URL.</strong> This code will let you click on the TR and it will take you to the URL posted in the tr onclick</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function DoNav(theUrl)
  {
  document.location.href = theUrl;
  }
  &lt;/script&gt;
  
  &lt;table width="100%" border="1" cellpadding="0" cellspacing="0"&gt;
     &lt;tr onclick="DoNav('http://www.google.com/');"&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td&gt;3&lt;/td&gt;
     &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p><strong>Here is my current code.</strong></p>
  
  <pre><code>echo str_repeat("&lt;form action=\"process.php\" method=\"post\"&gt;
  
      &lt;tr&gt;
      &lt;td&gt;&lt;input type=\"submit\" name=\"edit\" value=\"Edit\"&gt;&lt;/td&gt;
  
      &lt;td&gt;" . ($row['1']) . "&lt;input type=\"hidden\" name=\"date_added\" id=\"date_added\" readonly style=\"border: none;border-color: transparent;text-align: center;\" value=\"" . ($row['1']) . "\"&gt;&lt;/td&gt;
      &lt;td&gt;" . ($row['2']) . "&lt;input type=\"hidden\" name=\"carrier\" id=\"carrier\" readonly style=\"border: none;border-color: transparent;text-align: center;\" value=\"" . ($row['2']) . "\"&gt;&lt;/td&gt;
      &lt;td&gt;" . ($row['3']) . "&lt;input type=\"hidden\" name=\"trailer\" id=\"trailer\" readonly style=\"border: none;border-color: transparent;text-align: center;\" value=\"" . ($row['3']) . "\"&gt;&lt;/td&gt;
      &lt;td&gt;" . ($row['4']) . "&lt;input type=\"hidden\" name=\"door_number\" id=\"door_number\" readonly style=\"border: none;border-color: transparent;text-align: center;\" value=\"" . ($row['4']) . "\"&gt;&lt;/td&gt;
      &lt;td&gt;" . ($row['5']) . "&lt;input type=\"hidden\" name=\"time_in\" id=\"time_in\" readonly style=\"border: none;border-color: transparent;text-align: center;\" value=\"" . ($row['5']) . "\"&gt;&lt;/td&gt;
      &lt;td&gt;" . ($row['6']) . "&lt;input type=\"hidden\" name=\"time_out\" id=\"time_out\" readonly style=\"border: none;border-color: transparent;text-align: center;\" value=\"" . ($row['6']) . "\"&gt;&lt;/td&gt;
      &lt;td&gt;" . ($row['7']) . "&lt;input type=\"hidden\" name=\"po_number\" id=\"po_number\" readonly style=\"border: none;border-color: transparent;text-align: center;\" value=\"" . ($row['7']) . "\"&gt;&lt;/td&gt;
      &lt;td&gt;" . ($row['8']) . "&lt;input type=\"hidden\" name=\"update_notes\" id=\"update_notes\" rows=\"1\" cols=\"30\" readonly style=\"text-align: justify;\" value=\"\"&gt;" . ($row['8']) . "&lt;/textarea&gt;&lt;/td&gt;
  
      &lt;/tr&gt;&lt;/form&gt;",1);
  </code></pre>
  
  <p><strong>Currently my site looks like this.</strong></p>
  
  <pre><code>─────────────────────────────────────────────────────────────────────────────
  |    |DATE      |CARRIER|TRAILER #|DOOR #|TIME IN |TIME OUT|P.O. #    |NOTES|
  |Edit|2017-10-27|England|18410    |26    |18:15:59|20:34:27|4555894722|     |
  |Edit|2017-10-25|England|25688    |18    |10:13:45|16:37:01|4555821145|     |
  |Edit|2017-10-24|Central|581324   |35    |05:38:45|12:37:21|4555874774|     |
  ─────────────────────────────────────────────────────────────────────────────
  </code></pre>
  
  <p><strong>I want to get rid of the Edit button and instead have the whole TR be the Edit button.</strong></p>
  
  <pre><code>────────────────────────────────────────────────────────────────────────
  |DATE      |CARRIER|TRAILER #|DOOR #|TIME IN |TIME OUT|P.O. #    |NOTES|
  |2017-10-27|England|18410    |26    |18:15:59|20:34:27|4555894722|     |
  |2017-10-25|England|25688    |18    |10:13:45|16:37:01|4555821145|     |
  |2017-10-24|Central|581324   |35    |05:38:45|12:37:21|4555874774|     |
  ────────────────────────────────────────────────────────────────────────
  </code></pre>