Have you ever needed to count how many months there are from one date to the next - I have (sorry I was bored and the TV had just finished playing one of those "info-mercials").

Here is the script that does this anyway

function monthDate() {
var end_date = document.thisForm.expiry_date.value; //this is the input box variable for the end date
var today_date = document.thisForm.current_date.value; //this is the input box variable for the start date
var Today = new Date(today_date);
var DateToFind = new Date(end_date);
var difference1 = (DateToFind.getMonth() + 1);
var difference11 = (Today.getMonth() + 1);
var difference111 = difference1 - difference11;
var difference2 = (DateToFind.getFullYear());
var difference22 = (Today.getFullYear());
var difference222 = difference2 - difference22;
if (difference222 == 0) {
document.thisForm.months_remaining.value = difference111; // this is the input box where the value gets returned to
}
if (difference222 == 1) {
document.thisForm.months_remaining.value = difference222 * 12 + difference111;
}

}

I am sure that someone could do this quicker/easier- but this works

wabirdman