<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function check(ff)
{
var start = ff.from.value;
var end = new date();
alert(end);
var c_month = end.getMonth();
var c_day = end.getDate();
var c_year = end.getYear();
var fulldate = "" + c_month + "/" + c_day + "/" + c_year;
alert(fulldate);
var stDate = new Date(start);
var enDate = new Date(fulldate);
var compDate = enDate - stDate;
if(compDate >= 0)
{
alert("valid");
return true;
}
else
{
alert("Please Enter the correct date ");
return false;
}
}
</script>
</head>
<body>
<form id="fff" name="fff" method="post" action="" style="">
<input type="text" name="from" id="from"/>
<input type="text" name="to" id="to"/>
<Input type="submit" name="insert" id="insert" value="Insert" onclick="return check(fff)"/>
</form>
</body>
</html>
This code is not working please any one tell me what is the mistake in this code.
This post has been edited by CTphpnwb: 19 February 2012 - 05:03 PM
Reason for edit:: Fixed code tags

New Topic/Question
Reply


MultiQuote




|