title: How to clear previously filled in contents from HTML controls of Bootstrap modal dialog?
body: <p>I'm using <strong>Bootstrap framework v3.3.0</strong> for my website.</p>
  
  <p>I'm dealing with multiple modal dialog boxes. In one dialog there is one form having one textfield, one date control and one file control. After submitting the form successfully I hide this modal and show another modal with success message. On this modal there is one button having text "Submit another form". When user clicks on this button the dialog containing success message get close and the modal dialog containing form opens but it contains the previous values that I filled in. I don't want these values again. I want to clear these fields. How should I do this?</p>
  
  <p>Following is the code:</p>
  
  <p>HTML code:</p>
  
  <pre><code>&lt;div class="modal fade" id="newModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;
        &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content"&gt;
            &lt;div class="modal-header"&gt;
              &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
              &lt;h4 class="modal-title"&gt;Submit Form&lt;/h4&gt;
            &lt;/div&gt;
            &lt;div class="modal-body" style="max-height: 300px; overflow-y: auto;"&gt;
              &lt;br/&gt;
              &lt;!-- The form is placed inside the body of modal --&gt;
              &lt;form id="request_form" method="post" class="form-horizontal" enctype="multipart/form-data" action=""&gt;
                &lt;div class="form-group"&gt;
                  &lt;label class="col-sm-4 col-sm-offset-1 control-label"&gt;Reg ID &lt;span style="color:#FF0000"&gt;*&lt;/span&gt; :&lt;/label&gt;
                  &lt;div class="col-sm-5"&gt;
                    &lt;input type="text" class="form-control" name="reg_id" id="reg_id"/&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="form-group"&gt;
                  &lt;label class="col-sm-4 col-sm-offset-1 control-label"&gt;Reg Date&lt;span style="color:#FF0000"&gt;*&lt;/span&gt; :&lt;/label&gt;
                  &lt;div class="col-sm-5"&gt;
                    &lt;input type="text" class="form-control date_control" id="reg_date" name="reg_date" value="" placeholder="yyyy-mm-dd"&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="form-group"&gt;
                  &lt;label class="col-sm-4 col-sm-offset-1 control-label"&gt;Upload Image&lt;span style="color:#FF0000"&gt;*&lt;/span&gt; :&lt;/label&gt;
                  &lt;div class="col-sm-5"&gt;                   
                    &lt;input type="file" name="reg_image" id="reg_image" accept="image/*" capture="camera" /&gt;                  
                  &lt;/div&gt;
                &lt;/div&gt;  
                &lt;div class="form-group"&gt;
                  &lt;div class="col-sm-5 col-sm-offset-5"&gt;
                    &lt;button type="submit" class="btn btn-success" id="btn_receipt_submit"&gt;Submit&lt;/button&gt;
                    &lt;button type="button" class="btn btn-danger" data-dismiss="modal"&gt;Cancel&lt;/button&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/form&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  &lt;div class="modal fade" id="successModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;
        &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content"&gt;
            &lt;div class="modal-header"&gt;
              &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
              &lt;h4 class="modal-title"&gt;Your Request Uploaded Successfully&lt;/h4&gt;
            &lt;/div&gt;
            &lt;div class="modal-body" style="max-height: 300px; overflow-y: auto;"&gt;
              &lt;h4 style="font-weight:bold;text-align: center;"&gt;Thank you!&lt;/h4&gt;
              &lt;p style="text-align: justify;"&gt;Your request has been successfully submitted.&lt;/p&gt;
              &lt;div class="modal-footer" style="text-align:center;"&gt;
                &lt;button type="button" class="btn btn-danger" id="btn_exit"&gt;Exit&lt;/button&gt;
                &lt;button type="button" class="btn btn-success" data-dismiss="modal" id="btn_scan_another"&gt;Scan Another Receipt&lt;/button&gt;        
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>The jQuery code :</p>
  
  <pre><code>$(document).ready(function() {
  $("#btn_scan_another").on("click", function(event){
      event.preventDefault();
      $('#successModal').modal('hide');
  
      $('#newModal').modal('show');    
    });
  
  });
  </code></pre>
  
  <p>Thanks.</p>