Try this code:
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script>function date()
{
t1=document.getElementById("text1").value;
t2=document.getElementById("text2").value;
var one_day=1000*60*60*24;
var x=t1.split("/");
var y=t2.split("/");
var date1=new Date(x[2],(x[1]-1),x[0]);
var date2=new Date(y[2],(y[1]-1),y[0])
var month1=x[1]-1;
var month2=y[1]-1;
_Diff=Math.ceil((date2.getTime()-date1.getTime())/(one_day));
if(_Diff<0)
{
alert("seelct correct date");
}
}
</script>
</head> <body>
<form id="Form1" runat="server" >
<input type="text" id="text1" />
<input type="text" id="text2" />
<input type="button" value="check" onclick="date()" />
</form>
</body>
</html>