不知道有没有人愿意回答这么简单的问题 不能这样用!在form标签里写:<form onsubmit="return check()"> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <script>function check() { if(document.login.userName.value=="") { alert("用户名不能为空"); return false; } if(document.login.password.value=="") { alert("密码不能为空"); return false; } if(document.login.checkCode.value=="") { alert("效验码不能为空"); return false; } return true;}</script><body><form name=login method=post action="http://192.168.13/test/1.asp">用户名:<input type=text name="userName"><br>密码:<input type=password name="password"><br>校验码:<input type=text name="checkCode"><br><input type=submit value=submit onclick="return check();"></form></body> <input type="submit" name="Submit" value="登陆" onClick=return check()>改成 type="button"函数最后加上 login.submit(); <form name="login"><input type="button" name="Submit" value="登陆" method=post onClick="return check()"></form><script language="javascript">function check() { alert("这里都没有执行"); if(document.login.name==null||document.login.name=="") { alert("用户名不能为空"); return false; } if(document.password.name==null||document.password.name=="") { alert("密码不能为空"); return false; } if(document.check.name==null||document.check.name=="") { alert("效验码不能为空"); return false; } login.submit();;}</script> 怎样定位到指定的页面?例如next.html,回答了马上结帖。怎样定位到指定的页面?例如next.html,回答了马上结帖。怎样定位到指定的页面?例如next.html,回答了马上结帖。怎样定位到指定的页面?例如next.html,回答了马上结帖。怎样定位到指定的页面?例如next.html,回答了马上结帖。怎样定位到指定的页面?例如next.html,回答了马上结帖。怎样定位到指定的页面?例如next.html,回答了马上结帖。怎样定位到指定的页面?例如next.html,回答了马上结帖。怎样定位到指定的页面?例如next.html,回答了马上结帖。怎样定位到指定的页面?例如next.html,回答了马上结帖。怎样定位到指定的页面?例如next.html,回答了马上结帖。怎样定位到指定的页面?例如next.html,回答了马上结帖。 <script>location='next.html';</scrpt> 点击事件e.target怎么指向本身,冒泡事件? 当一个a链接的HREF里有值了,再次用attr能否改变其值。 C#中事件处理中的小问题 js实现删除后关闭对话框 如何通过部分名字得到控件? Extjs 4.0 异步加载子节点 javascript小程序,为什么两物体碰撞后不是按照90度改变方向前进 虚心请教:谁能帮我把这个非常漂亮的导航菜单多加一级子菜单?(真的很不错) 怎么去取得变量的值啊? 100分求“我佛山人"的表单验证的详细解析 ***************简单问题!大家帮忙************* 急:怎么读取表格中的数据,在线等!
function check() {
if(document.login.userName.value=="") {
alert("用户名不能为空");
return false;
}
if(document.login.password.value=="") {
alert("密码不能为空");
return false;
}
if(document.login.checkCode.value=="") {
alert("效验码不能为空");
return false;
}
return true;
}</script>
<body>
<form name=login method=post action="http://192.168.13/test/1.asp">
用户名:<input type=text name="userName"><br>
密码:<input type=password name="password"><br>
校验码:<input type=text name="checkCode"><br>
<input type=submit value=submit onclick="return check();">
</form>
</body>
改成 type="button"
函数最后加上 login.submit();
<input type="button" name="Submit" value="登陆" method=post onClick="return check()">
</form>
<script language="javascript">
function check() {
alert("这里都没有执行");
if(document.login.name==null||document.login.name=="") {
alert("用户名不能为空");
return false;
}
if(document.password.name==null||document.password.name=="") {
alert("密码不能为空");
return false;
}
if(document.check.name==null||document.check.name=="") {
alert("效验码不能为空");
return false;
}
login.submit();;
}
</script>
怎样定位到指定的页面?例如next.html,回答了马上结帖。
怎样定位到指定的页面?例如next.html,回答了马上结帖。
怎样定位到指定的页面?例如next.html,回答了马上结帖。
怎样定位到指定的页面?例如next.html,回答了马上结帖。
怎样定位到指定的页面?例如next.html,回答了马上结帖。
怎样定位到指定的页面?例如next.html,回答了马上结帖。
怎样定位到指定的页面?例如next.html,回答了马上结帖。
怎样定位到指定的页面?例如next.html,回答了马上结帖。
怎样定位到指定的页面?例如next.html,回答了马上结帖。
怎样定位到指定的页面?例如next.html,回答了马上结帖。
怎样定位到指定的页面?例如next.html,回答了马上结帖。
location='next.html';
</scrpt>