Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> date checking ???
Hi all,
May I ask a javascript question?? (sorry to post here!) below is a form checking input date. The input date cann't be earlier than today. But it also compares hours and minutes which I don't want. Suppose you input 08/20/2003, it thinks it's 08/20/2003 00:00:00 which is earlier than now (08/20/2003 15:30:00). How to solve this?? Thank you!
<html>
<head>
<script>
function validate(){
var obj = document.forms("shipping");
//$$ sending date cannot be earlier than today
now = new Date(); sDate = obj.p_sending_date.value; sDate = sDate.substring(0,2) + "/" +sDate.substring(3,5) + "/" + sDate.substring(6,10);
inputDate = new Date(sDate);
if (inputDate < now) { alert("Sending date cannot be earlier than today."); }else{ alert("ok"); }
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Andrea Oracle INET: andreaoracle_at_yahoo.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Wed Aug 20 2003 - 17:49:25 CDT
![]() |
![]() |