title: How to call a function after a date is selected from a date picker?
body: <p>I'm quite new to javascript and JSP and am having a difficult time wrapping my head around what's getting called and when and where. I'm writing this all in a single JSP file. The starting code I have right now is:</p>
  
  <pre><code>&lt;input type=text name="myTextField" &gt;
  &lt;input type=button name="myTextButton" value="Select a date" 
    onclick="displayDatePicker(myTextField)"&gt;
  
  &lt;script type="text/javascript"&gt;
  // ???
  &lt;/script&gt;
  </code></pre>
  
  <p>The first thing that confuses me is the displayDatePicker function. I can't for the life of me find any documentation on this function (is it jquery? is it javascript? is it bootstrap? can i pass in other args?). An alternative would be to declare a custom function and have myTextButton's onclick call that function. I managed to get that to work, but I don't know how to display a datepicker that actually has a callback when a date is chosen.</p>
  
  <p>Here's the functionality I want to have:</p>
  
  <ol>
  <li>User clicks on myTextField, manually types in a date, then an alert
  pops up "You selected ../../...." or "Invalid date selected"</li>
  <li>User clicks on myTextButton, selects a date from the date picker,
      then myTextField is populated with that date and an alert pops up "You selected ../../...."</li>
  </ol>