Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing two dates in Javascript 1

Status
Not open for further replies.

CHRISWYA

IS-IT--Management
Sep 14, 2004
19
GB
if (theForm.p_open_date.value > theForm.p_close_date.value)
{
alert("The close date entered is invalid");
theForm.p_close_date.focus();
return false;
}
}
return true;
}

Hi there i have this javascript which checks an open_date value against a close_date value and this works fine. However close_date can also be null and this javascript blocks this from occuring.

I think this will be relatively simple but am a javascript novice.

any suggestions
cheers
 
if(theForm.p_close_date.value!=0)
{
if (theForm.p_open_date.value > theForm.p_close_date.value)
{
alert("The close date entered is invalid");
theForm.p_close_date.focus();
return false;
}
}
return true;
}
}

Known is handfull, Unknown is worldfull
 
no problemmo...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top