Convert date format in javascript
<p>I have an input field that on page load looks like this:</p>

<pre><code>&lt;input type="input" id="start_date" name="start_date" value="May 12, 2012"/&gt;
</code></pre>

<p>I want the following to happen:</p>

<ul>
<li>When a user clicks on the field to enter a date, the format changes to YYYY-MM-DD. (2012-05-12)</li>
<li>After a user leaves the field, the format changes back to MMM DD, YYYY (May 12, 2012).</li>
<li>When the data is submitted via post, it is in the format YYYY-MM-DD (2012-05-12).</li>
</ul>

<p>How would I accomplish this with jQuery?</p>
