title: Setting textbox value in modal window using onclick button using Bootstrap
body: <p>I ma trying to display username in modal text box using onclick button
  I have a button from there on <code>onclick</code> i am calling <code>onclick="getUserName(this.id)"</code></p>
  
  <pre><code>this.id 
  </code></pre>
  
  <p>gives me name which i want to set in </p>
  
  <pre><code>modal textbox userName
  </code></pre>
  
  <p><strong>Here is my function</strong></p>
  
  <pre><code>function getUserName(username) {
        $('#editUserPopUp').bind('show',function(){
            alert(username);
            $("#userName").val(username);
        });
   }
  </code></pre>
  
  <p>I am getting username in <code>alert(username)</code>
  but how do i set thsi value to my modal, username text field</p>
  
  <p><strong>Here is my Modal</strong></p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div class="modal fade" id=editUserPopUp tabindex="-1" 
      role="dialog" aria-labelledby="helpModalLabel" aria-hidden="true"&gt;
    &lt;div class="modal-dialog "&gt;
      &lt;div class="modal-content"&gt;
          &lt;div class="modal-header"&gt;
            &lt;h4 class="modal-title" id="myModalLabel"&gt;Update Password&lt;/h4&gt;
          &lt;/div&gt;
          &lt;div class="modal-body"&gt;                                                                                    
          &lt;form class="EditUserBody" role="form" id="usermanagement_editUser="novalidate" method="POST"&gt;
            &lt;div class="input-group col-md-8"&gt;
             &lt;span class="input-group-addon"&gt;User Name&lt;/span&gt;
               &lt;input class="form-control" id="userName" type="text" class="input-medium" disabled /&gt;
            &lt;/div&gt;           
          &lt;/form&gt; 
         &lt;/div&gt;   
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt; 
  </code></pre>