title: PHP HTML form and Java datepicker
body: <p>I have an HTML form which preloads with data from MySQL. I have added one form field "New Follow Up" to have a popup calendar using datepicker. The datepicker returns a DATE format, which I need to convert to DATETIME for MySQL. The return is currently <code>date_followup</code>.</p>
  
  <p>I was wondering if this could be done within the <code>&lt;script&gt;</code> function, so that the <code>date_followup</code> could be in the standard DATETIME format, elimination the conversion. Or is there an easier way? </p>
  
  <pre><code>&lt;div class="control-group &lt;?php echo !empty($date_followupError)?'error':'';?&gt;"&gt;
      &lt;label class="control-label"&gt;New Followup Date&lt;/label&gt;
      &lt;div class="controls"&gt;
          &lt;input name="date_followup" type="text" placeholder="Enter Follow up date" value="&lt;?php echo !empty($date_followup)?$date_followup:'';?&gt;"&gt;
          &lt;?php if (!empty($date_followupError)): ?&gt;
          &lt;span class="help-inline"&gt;&lt;?php echo $date_followupError;?&gt;&lt;/span&gt;
          &lt;?php endif;?&gt;
  
          &lt;head&gt;
              &lt;link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css"&gt;
              &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"&gt;&lt;/script&gt;
              &lt;script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"&gt;&lt;/script&gt;
              &lt;script&gt;
                  $(document).ready(function() {
                      $("#datepicker").datepicker();
                  });
              &lt;/script&gt;
          &lt;/head&gt;
  
          &lt;body&gt;
              &lt;input id="datepicker" input name="date_followup"&gt;
          &lt;/body&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>