解决方法三
如果是form体提交的话还可以把summit改成button调用js提交,这样window.location.href也会在js提交summit之前执行成功跳转。
如下:
function checkUser()
{
if(<%=flag%>!=1){
window.location.href="login.jsp" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" ;
return false;
}
document.getElementById("form").submit();
}
<form action="addRoom" method="post" name="from" id="form">
<table align="center" border="1" class="commTable">
<tr>
<td class="right"><span
style="font-weight: blod;">房号:</span></td>
<td><input type="text" name="roomNum" size="25"
id="roomNum" /></td>
</tr>
<tr>
<td colspan="2" align="center"><button value="添加"
onclick="checkUser()" /></td>
</tr>
</table>
</form>
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
更多相关内容:
-
无相关信息
