title: Varying modal content based on trigger with input: radio and checkbox
body: <p>I am using Net mvc4 in this project. I got a problem in my javascript where the 
  <code>modal.find('modal-body input:radio[name=require_attachment][id=' + attachment+ ']').prop('checked', true);</code> </p>
  
  <p>It does not function properly. I also tried the jquery <code>filter</code> function:</p>
  
  <p><code>modal.find('modal-body input:radio[name=require_attachment]').filter(['value=' + attachment+ '']).prop('checked', true);</code></p>
  
  <p>Which has the same result, not working.</p>
  
  <p>In my modal <code>button</code> that has data-* on with.e.g. <code>data-attachment</code>, I want to display it as a radio <code>checked</code> whether what value it return to the content of my modal. </p>
  
  <pre><code>&lt;button type="button" class="btn btn-primary"
          data-toggle="modal"
          data-target="#Update_COA_Codes"
          data-code="@item.code"
          data-attachment="@item.require_attachment"             
          data-status="@item.status"
          data-description="@item.description"&gt;Edit&lt;/button&gt;
  </code></pre>
  
  <p>Inside my jquery script:</p>
  
  <pre><code>$('#Update_COA_Codes').on('show.bs.modal', function (event) {   
    var button = $(event.relatedTarget)
    var attachment = button.data('attachment');
    //... other code here
  
    var modal = $(this);
    modal.find('modal-body input:radio[name= require_attachment]')
         .filter(['value=' + attachment + ''])
         .prop('checked', true);
  });
  </code></pre>
  
  <p>HTML modal-body</p>
  
  <pre><code>&lt;div class="row top-buffer"&gt;
    &lt;div class="col-md-4"&gt;
      &lt;label&gt;&lt;span class="red"&gt;*&lt;/span&gt;Needs Attachments?&lt;/label&gt;
    &lt;/div&gt;
    &lt;div class="col-md-4"&gt;
      &lt;input type="radio" name="require_attachment" value="true"&gt; Yes
      &lt;input type="radio" name="require_attachment" value="false"&gt; No
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I'm not sure if this is the correct way of doing it. I'm open for any suggestions, thank you.</p>