|
Hi all
I got 1 strange problem in java script here is the code please help me i am really stuck and i have to complete this project today.
i have to check that a date and time should be greater then current date and time
I am geeting date and time for date time picker as format mm//dd/YY hr:mm:ss
so here is the code
strdate = document.addSession.startDateTime;
var newdate = new Date(strdate.value);
if(document.addSession.startDateTime.value == "")
{
alert("Enter the Start Date");
document.addSession.startDateTime.focus();
return false;
}
else
{
var newdate = new Date(strdate.value);
var curdate = new Date();
if (curdate > newdate)
{
alert("Check the start Date and Time");
document.addSession.startDateTime.select();
document.addSession.startDateTime.focus();
return false;
}
}
Its working fine in all other browser like IE,netscape,Mozila
but its not working properly in Mac Safari Browser
If a alert(newdate)
its always giving some date like 14th dec 1901 time some 3 o clcok
|
|
|
|
|
|
|
© Copyright codetoad.com 2001-2005 |
|
|