急,检测表单,怎么用JAVASCRIPT来比较两个日期。 http://expert.csdn.net/Expert/topic/2960/2960478.xml?temp=.4676782 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <script>date1 = "2004-05-03"; //入住时间date2 = "2004-02-11"; //离店时间now = Date(); //现在时间s1 = Date.parse(date1.replace("-","/"));s2 = Date.parse(date2.replace("-","/"));s3 = Date.parse(now);if (s1>s2 || s1>s3) alert("输入有误");</script> <script language="javascript">function a(s1,s2){ d1 = new Date(s1); d1 = d1.getTime(); d2 = new Date(s2); d2 = d2.getTime(); return d2>d1}</script>日期格式:MM/DD/YYYY<br>Start:<input type=text name="txt1"><br>End:<input type=text name="txt2"><br><input type=button onclick="alert(a(document.all.txt1.value,document.all.txt2.value))"value="Test"> <script>function check(date1,date2){ now = Date(); //现在时间 s1 = Date.parse(date1.replace("-","/")); s2 = Date.parse(date2.replace("-","/")); s3 = Date.parse(now); if (s1>s2 || s1>s3) { alert("输入有误"); return false; } return true;}</script>Start:<input type=text name="txt1"><br>End:<input type=text name="txt2"><br><input type=button onclick="check(txt1.value,txt2.value)"value="Test"> towanghr100(灰豆宝宝.net) 那若是true就不要弹出窗口呀。要怎么改呀。thanks onclick="return a(txt1.value,txt2.value)" jquery引用报NetworkError: 400 Bad Request 删除以及循环添加<ul>下<li>标签问题 QQ第三方登陆 JS版 关于JavaScrip操作Cookie子键的问题 请教页面跳转无刷新的问题 关于form 和frame的问题??????????? 如何将html里的<div></div>隐藏,且让它不在显示上占空间 怎么去演示循环语句代码呢!!! 关于form的提交后传出的参数 a标签href方法调用的疑问 我的Textbox框内有用户输入的本地文件地址,如何保存该文件到数据库? Netscape问题
date1 = "2004-05-03"; //入住时间
date2 = "2004-02-11"; //离店时间
now = Date(); //现在时间
s1 = Date.parse(date1.replace("-","/"));
s2 = Date.parse(date2.replace("-","/"));
s3 = Date.parse(now);
if (s1>s2 || s1>s3)
alert("输入有误");
</script>
function a(s1,s2)
{
d1 = new Date(s1);
d1 = d1.getTime();
d2 = new Date(s2);
d2 = d2.getTime();
return d2>d1
}
</script>
日期格式:MM/DD/YYYY
<br>
Start:<input type=text name="txt1">
<br>
End:<input type=text name="txt2">
<br>
<input type=button onclick="alert(a(document.all.txt1.value,document.all.txt2.value))"
value="Test">
function check(date1,date2)
{
now = Date(); //现在时间
s1 = Date.parse(date1.replace("-","/"));
s2 = Date.parse(date2.replace("-","/"));
s3 = Date.parse(now);
if (s1>s2 || s1>s3)
{
alert("输入有误");
return false;
}
return true;
}
</script>
Start:<input type=text name="txt1">
<br>
End:<input type=text name="txt2">
<br>
<input type=button onclick="check(txt1.value,txt2.value)"
value="Test">
towanghr100(灰豆宝宝.net) 那若是true就不要弹出窗口呀。
要怎么改呀。thanks