Change your code around to be like this:
Code:
function CheckExpire()
{
var currdate = new Date()
var userdate = new Date(document.form.ExpireDate.value)
if (userdate <= currdate){
window.open("Your product is already expired")
}
You should also probably check for a valid entry in the form field. If the field was null, the
userdate date object would evaluate to the current date and time, which would cause the code to say the product is expired.
A good book for Javascript is the
Javascript Bible
Bruce Luckcuck
Director, Applications & Support Services
Wiley Publishing, Inc.