title: Modal reopens automatically after clicking the closing button
body: <p>I've been trying to dynamically create a modal view in a table.</p>
  
  <p>The data used to create the table is comming from a sql database.</p>
  
  <p>Now my problem:</p>
  
  <p>Whenever I click on a button called "Details" the modal view is opening and contains the data it should.
  However, when I try to close the view with the "Close"- Button or the X in the top right corner the modal view will close for a second and reopen on its own.
  The background will get darker after I do one of the above mentioned operations.</p>
  
  <p>Here comes the tricky part. Whenever I close the view with the escape button on my keyboard, it'll close as it should and I'll get back to my previous view.</p>
  
  <pre><code>&lt;?php
  mysql_connect("localhost", "****" , "****");
  mysql_select_db("hallo");
  
  $sql= "SELECT * FROM erfassung WHERE Status='Abgeschlossen'";
  $query=mysql_query($sql) or die (mysql_error());
  
  while($row = mysql_fetch_assoc($query)) {
  
      $thisId = $row['id'];
      $thisModalId = 'modal'.$thisId;
      $thisModalIdHref = '#'.$thisModalId;
      $thisFormDoneId = $row['id'].'FormDoneId';
    // Create table row
    echo "&lt;tr onclick=\"input\" data-toggle=\"modal\" href='$thisModalIdHref'&gt;";
      echo "&lt;td&gt;";
      echo $row['Name'];
      echo "&lt;td&gt;";
      echo $row['Betreff'];
     echo "&lt;td&gt;";
     echo "&lt;button class=\"btn btn-primary btn-lg\" data-toggle=\"modal\" data-target='$thisModalIdHref'&gt;";
     echo   "Details";
     echo "&lt;/button&gt;";
  
  
  echo"&lt;div class=\"modal fade\" id='$thisModalId' tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\"&gt;";
   echo "&lt;div class=\"modal-dialog\"&gt;";
     echo "&lt;div class=\"modal-content\"&gt;";
      echo  "&lt;div class=\"modal-header\"&gt;";
       echo  "&lt;button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\"&gt;&amp;times;&lt;/button&gt;";
        echo  "&lt;h4 class=\"modal-title\" id=\"myModalLabel\"&gt;Weitere Information &lt;/h4&gt;";
         echo "&lt;/div&gt;";
          echo"&lt;div class=\"modal-body\"&gt;";
          echo "&lt;dl class=\"dl-horizontal\"&gt;";
          echo "&lt;dt&gt;Bereich&lt;/dt&gt;";
          echo "&lt;dd&gt;" .$row['Bereich']. "&lt;/dd&gt;";
          echo "&lt;/dl&gt;";
          echo"&lt;/div&gt;";
         echo"&lt;div class=\"modal-footer\"&gt;";
         echo "&lt;button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\"&gt;Close&lt;/button&gt;";
         echo "&lt;button type=\"button\" class=\"btn btn-primary\"&gt;Save changes&lt;/button&gt;";
        echo"&lt;/div&gt;";
      echo"&lt;/div&gt;"; //&lt;!-- /.modal-content --&gt;
     echo"&lt;/div&gt;";//&lt;!-- /.modal-dialog --&gt;
   echo"&lt;/div&gt;";//&lt;!-- /.modal --&gt;
      echo "&lt;/td&gt;";
    echo "&lt;/tr&gt;";
  }
  
  ?&gt;
  </code></pre>
  
  <p>For clarification:</p>
  
  <p>If the $thisModalId is changed to the previous "MyModal" it works, but the button will, as it's supposed to, open the same text.</p>
  
  <p>If you need any more source code or something else, I'd be more than happy to post it.</p>
  
  <p>Thanks in advance for your help guys.</p>
  
  <p>Best regards.</p>