<script>
function checkValue(){
var username = document.form.username.value;
var password = document.form.password.value;
if(username == ''){
alert("用户名不能为空!");
return ;
}
if(password == ''){
alert("密码不能为空!");
return ;
}
document.form.action = "login.do";
}
</script>
<form name="form" method="post">
<table>
<tr>
<td>用户名:</td>
<td><input name="username" type="text" value=""/></td>
</tr>
<tr>
<td>密码:</td>
<td><input name="password" type="text" value=""/></td>
</tr>
<tr>
<td><input type="submit" value="提交" οnclick="checkValue();"/></td>
</tr>
</table
</form>
js提交表单
最新推荐文章于 2021-12-13 17:16:46 发布