I have 2 inputs:
<input type="text" name="EffectiveDate" id="EffectiveDate" />
<input type="text" name="ExpirationDate" id="ExpirationDate" />
Expiration date needs to be set to the value of EffectiveDate + 1 Year.
Input is in the format mm/dd/yyyy and required to be as such.
I started out with the script below:
$(document).ready(function() {
$("#EffectiveDate").change(function () {
var d = new Date();
d.setDate(d.getDate());
$("#ExpirationDate").val(formatDate(_date));
});
function formatDate(date) {
var day = date.getDate();
var month = date.getMonth() + 1;
var year = date.getFullYear() + 1;
if (day < 10) day = "0" + day;
if (month < 10) month = "0" + month;
return day + "/" + month + "/" + year;
}
Could someone please assist me with getting the ExpirationDate to populate correctly.
Thank you in advance,
Joe Scarpetta
Apphia Solutions, LLC