title: Bootstrap modal doesn't work on live server
body: <p>Trigger Button:</p>
  
  <pre><code>while ($row = mysqli_fetch_array($result)) {
          $name = $row['name'];
          $id = $row['id'];
          echo '&lt;a data-target="#exampleModal" class="wpmui-field-input button wpmui-submit button-primary" data-toggle="modal" data-whatever="'.$name.'"&gt;Details&lt;/a&gt;';
          echo $id . "&lt;br&gt;";
      }  
  </code></pre>
  
  <p>Modal:  </p>
  
  <pre><code>echo'
  &lt;div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"&gt;
    &lt;div class="modal-dialog" role="document"&gt;
      &lt;div class="modal-content"&gt;
        &lt;div class="modal-header"&gt;
          &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;
          &lt;h4 class="modal-title" id="exampleModalLabel"&gt;New message&lt;/h4&gt;
        &lt;/div&gt;
        &lt;div class="modal-body"&gt;
          &lt;form&gt;
            &lt;textarea class="form-control"&gt;&lt;/textarea&gt;
          &lt;/form&gt;
        &lt;/div&gt;
        &lt;div class="modal-footer"&gt;
          &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
          &lt;button type="button" class="btn btn-primary"&gt;Send message&lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;';
  </code></pre>
  
  <p>JavaScript:  </p>
  
  <pre><code>echo'
  &lt;script type="text/javascript"&gt;
      window.onload = function () { 
          $("#exampleModal").on("show.bs.modal", function (event) {
    var button = $(event.relatedTarget) // Button that triggered the modal
    var recipient = button.data("whatever") // Extract info from data-* attributes
    var modal = $(this)
    modal.find(".modal-title").text("New message to " + recipient)
    modal.find(".modal-body textarea").val(recipient)
  })
       }
  &lt;/script&gt;';  
  </code></pre>
  
  <p>Now I have all these codes above that will generate a Modal Box when clicked on that Trigger Button. This code seems to work fine in my localhost but it doesn't act the same in my server, and the values returned are <code>undefined</code>. Now, I think it might have something to do with the PHP Version, because my localhost has PHP7 and my server has PHP5. Does this mean  in PHP5 does not support value field (JavaScript is <code>.val()</code>) in the <code>&lt;textarea&gt;</code> tag as in <code>&lt;textarea value="something"&gt;</code>?  </p>
  
  <p>Even if that's the case, what is the workaround for this problem? I tried using <code>.html()</code> and <code>.text()</code> but all it does is overwriting the value, and when you open up the modal box once again, the value will be the same for ALL modal boxes (whereas it should be different value for each recipient modal box).</p>