title: How to get selected date into the text box from the calendar-that popup from Icon?
body: <p>I am designing a project in Asp.net-MVC 5 with C#. I am having a textbox along with a calendar Icon attached at the end. 
  codings below:</p>
  
  <p><strong>Design:</strong></p>
  
  <pre><code>&lt;div class="col-md-4  col-lg-4"&gt;
     &lt;label&gt;From&lt;/label&gt;
     &lt;div class="input-group date"&gt;
        &lt;input type="text" name="q" id="txtFrom" class="form-control" &gt;
        &lt;span class="input-group-btn"&gt;
        &lt;button type="submit" name="search" id="datepicker" class="btn btn-flat btn-success"&gt;
        &lt;i class="fa fa-calendar"&gt;&lt;/i&gt;
        &lt;/button&gt;
        &lt;/span&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Script:</strong></p>
  
  <pre><code>&lt;script&gt;
          $(function () { 
            $('#txtFrom').datepicker({
             autoclose: true
         })       
     })
  &lt;/script&gt;
  </code></pre>
  
  <p>This one is working fine, like when I click the text box, the calendar pops up and the selected date was shown in 'From' text box.</p>
  
  <p><strong><em>But, What I need is-the calendar must pop up only if the calendar Icon got clicked and the selected date must be displayed in 'From' Text box.</em></strong></p>
  
  <p>If I changed the script as below</p>
  
  <p>Script:</p>
  
  <pre><code> &lt;script&gt;
          $(function () { 
            $('#datepicker').datepicker({
             autoclose: true
         })       
     })
  &lt;/script&gt;
  </code></pre>
  
  <p>then the Pop up comes when Calendar Icon got clicked, but the value not sent to the text box.
  Image of my TextBox Design :</p>
  
  <p><a href="https://i.stack.imgur.com/VXZM9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VXZM9.png" alt="Image of my TextBox Design"></a></p>
  
  <p>Kindly Help. TIA.</p>