JavaScript display expiry date upon user input of start/end date
<p>never programmed in JavaScript before, so I ask your assistance to display the expiry date when user chooses start and end date from the <strong>calendar</strong>. After selecting the end date from the <strong>calendar</strong>, the expiry date should display added two months to the end date. For example:
The user chooses Oct. 9, 2012 as Start Date; Oct. 16, 2012 as the end date; Dec. 16, 2012 should be the expiry date. How can I achieve this in JavaScript? </p>

<p>Please check this code, cause I don't know how to edit this one.</p>

<pre><code>/**
 * Click "Cal" on expiry date
 */
function getExpiryDate() {
if(!document.getElementById('enddate').value.length) {
    alert("End date must be set first.");
}
else {
    prevExpiryDate = document.getElementById('expirydate').value;
    displayCalendar(document.forms[0].expirydate,'yyyy/mm/dd',
        document.getElementById('expirydatebutton'));
}
}
</code></pre>
