deharris2003, here mate, have a play around with this code. Should get you further down the track.
[tt]
<html>
<head>
<script>
function doValidateField(objField){
// Get today's date
var dateToday = new Date();
//get the date from the string entered in the field
var dateEntered = new Date(objField.value);
// Subtracting two dates gives us the number of milliseconds
// between them
var intDateDiff = dateToday - dateEntered;
// Divide this by 86400000 (milliseconds in a day)
// and floor it to round off any decimal
var intDaysDiff = Math.floor(intDateDiff / 86400000);
//check if the days difference is less than 0
// ie some time in the future:
if(intDaysDiff < 0){
//if it is, alert the user
alert('The date cannot be greater than today\'s date.\n' +
'Please enter a date no greater than 90 days prior to today');
}
//check if the days difference is greater than 90
// ie too far in the past:
if(intDaysDiff > 90){
//if it is, alert the user
alert('The date cannot be more than 90 days prior to today.\n' +
'Please enter a date no greater than 90 days prior to today');
}
}
</script>
</head>
<body>
<input type="text"
name="fldDateEntered"
id="fldDateEntered"
onblur="doValidateField(this);"
value="9/24/2003">
</body>
</html>[/tt]
Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.