js表单提交的三种⽅式第⼀种:
<script type="text/javascript">
function check(form) {小英雄哪吒
if (form.urId.value == '') {
alert("请输⼊⽤户帐号!");
form.urId.focus();
return fal;
}
if (form.password.value == '') {
alert("请输⼊登录密码!");
form.password.focus();
生死成语return fal;
}
return true;
}双频无线路由器
</script>
<form action="login.do?act=login" method="post">
⽤户帐号
<input type=text name="urId" size="18" value="">
<br>望的词语
登录密码
<input type="password" name="password" size="19" value=""/>
<input type=submit name="submit1" value="登陆" onclick="return check(this.form)">
</form>
第⼆种
<script type="text/javascript">
function check(form) {
if (form.urId.value == '') {
alert("请输⼊⽤户帐号!");
form.urId.focus();
return fal;
}
我的愿望普通话三分钟if (form.password.value == '') {
alert("请输⼊登录密码!");
form.password.focus();
return fal;
}
return true;
}
</script>
<form action="login.do?act=login" method="post" onsubmit="return check(this)">
⽤户帐号
<input type=text name="urId" size="18" value="">
<br>
登录密码
<input type="password" name="password" size="19" value=""/>
夫妻感情<input type=submit name="submit1" value="登陆">
</form>
第三种顽强的生命
<script type="text/javascript">
function check(form) {
if (form.urId.value == '') {
alert("请输⼊⽤户帐号!");
form.urId.focus();
return fal;
}
if (form.password.value == '') {
alert("请输⼊登录密码!");
form.password.focus();
return fal;
}
浙江工商大学怎么样
}
</script>
<form action="login.do?act=login" name="myform" method="post">
⽤户帐号
<input type=text name="urId" size="18" value="">
<br>
登录密码
<input type="password" name="password" size="19" value=""/>
<input type=button name="submit1" value="登陆" onclick="check(this.form)">
</form>