title: HTML Selectable table with edit/delete/view options
body: <p>I have table, where you can select table rows, and it passes the information to modal window. But there is problem, I want the popup window to show error if there is no row selected</p>
  
  <p>Button to edit row</p>
  
  <pre><code>&lt;a class="icon icon-pencil js-popup js-tooltip" href="#edit" title="Edit selected row"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>JavaScript Code</p>
  
  <pre><code> $(document).on('click', '#table_contactgroups tbody tr', function(e) {
      $(this).addClass('selected').siblings().removeClass('selected');
  
      var name = $(this).find('td:first').html();
      var id = $(this).attr('id');
  
      $('#edit input[name="name"]').val(name)
      $('#edit input[name="id"]').val(id)
  
      $("#name").text(name);
      $('#delete input[name="id"]').val(id)
  });
  </code></pre>
  
  <p>Modal</p>
  
  <pre><code>&lt;div id="edit"&gt;
      &lt;h2 class="text-center ls-large"&gt;Edit contact group&lt;/h2&gt;
        &lt;form class="js-ajax-form" data-ajax-form="edit=a.logged-in;editFrom=
                 &lt;?php echo URL_BASE; ?&gt;template/header.php"
                        name="contacts-form" method="post"
                        action="&lt;?php echo URL_BASE; ?&gt;contactgroups/contactgroup_manager.php?a=edit"&gt;
                 &lt;fieldset&gt;
                          &lt;!-- &lt;input type="text" name="name" placeholder="Name"&gt;--&gt;
                   &lt;div class="input-wrap"&gt;
                      &lt;input type="text" name="name" maxlength="45" value="" placeholder="Name"&gt;
                   &lt;/div&gt;
                   &lt;input type="hidden" name="id" value=""&gt;
                &lt;/fieldset&gt;
               &lt;div class="controls multiple"&gt;
                   &lt;button class="btn btn-default btn-small" type="submit" name="Edit" value="Edit"&gt;Submit&lt;/button&gt;
                    &lt;a class="btn btn-unimportant btn-small js-popup-close" href="#"&gt;Cancel&lt;/a&gt;
               &lt;/div&gt;
       &lt;/form&gt;
  &lt;/div&gt;   
  </code></pre>