title: Cancel button on bootstrap modal doesn't clear filled data
body: <p>How to clear filled data when user clicks on the cancel button on my jQuery modal form.</p>
  
  <p>Currently when I click on the cancel button it only closes the popup box and when I reopen it previous filled data is still stored.</p>
  
  <p>Please advice</p>
  
  <pre><code> &lt;form id="myform2" data-toggle="validator" class="form-horizontal" role="form" method="POST" action="#"&gt;
          &lt;div class="form-group"&gt;
              &lt;div class="col-md-12"&gt;
                  &lt;label class="control-label popup-label"&gt;Full Name&lt;/label&gt;
                  &lt;input required type="text" class="form-control" name="full_name"
                         value="{{ old('full_name') }}"&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="form-group"&gt;
              &lt;div class="col-md-12"&gt;
                  &lt;label class="control-label popup-label"&gt;Username&lt;/label&gt;
                  &lt;input required type="text" class="form-control" name="username"
                         value="{{ old('username') }}"&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="form-group"&gt;
              &lt;div class="col-md-12"&gt;
                  &lt;label class="control-label popup-label"&gt;Password&lt;/label&gt;
                  &lt;input pattern=".{5,10}" required title="5 to 10 characters"
                         type="password" class="form-control"
                         name="password" value="{{ old('password') }}"&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="modal-footer"&gt;
              &lt;button type="submit" class="btn btn-primary"&gt;Create&lt;/button&gt;
              &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Cancel
              &lt;/button&gt;
          &lt;/div&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>I have used bootstrap validations as well for form fields.</p>
  
  <pre><code>$(document).ready(function () {
      $('#myform2').bootstrapValidator({
          // To use feedback icons, ensure that you use Bootstrap v3.1.0 or later
          icon: {
              valid: 'glyphicon glyphicon-ok',
              invalid: 'glyphicon glyphicon-remove',
              validating: 'glyphicon glyphicon-refresh'
          },
          fields: {
              full_name: {
                  validators: {
                      notEmpty: {
                          message: 'The Full Name field is required'
                      },
                      stringLength: {
                          min: 5,
                          max: 15,
                          message: 'The Full Name must be more than 5 and less than 15 characters long'
                      },
  </code></pre>
  
  <p>Edit</p>
  
  <p>Here is my password validation</p>
  
  <pre><code>password: {
      validators: {
          notEmpty: {
              message: 'The Password field is required.'
          },
          stringLength: {
              min: 5,
              max: 15,
              message: 'The Password must be more than 5 and less than 15 characters long'
          }
  
      }
  } 
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/gHqjT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gHqjT.png" alt="enter image description here"></a></p>