<form action=login method=post>
<table align=center>
<tr>
<td>账号:</td>
<td><input type=text name=id /></td>
</tr>
<tr>
<td>密码:</td>
<td><input type=password name=pwd /></td>
</tr>
<tr>
<td colspan=2 align=center><input type=submit value="登陆" />
<input type=button value="注册" /></td>
</tr>
</table>
</form>
这是我JSP登陆界面的表单 如何能点击 "注册"的按扭 跳到 ADD.JSP这个界面
<table align=center>
<tr>
<td>账号:</td>
<td><input type=text name=id /></td>
</tr>
<tr>
<td>密码:</td>
<td><input type=password name=pwd /></td>
</tr>
<tr>
<td colspan=2 align=center><input type=submit value="登陆" />
<input type=button value="注册" /></td>
</tr>
</table>
</form>
这是我JSP登陆界面的表单 如何能点击 "注册"的按扭 跳到 ADD.JSP这个界面
JS应该类似这样
function regist(){
try{
with(document.forms[0]){
^^^^^(为你想不为空或者其他限制条件)
submit();
}
}catch(e){
alert(e.message);
}
}
<input type="button" value="注册表" onclick="regist()">
<script type="text/javascript">
function regist(){
window.open(add.jsp);
}
</script>
<script language="javascript" type="text/javascript">
window.location.href="login.jsp?backurl="+window.location.href;
</script>第二种:
<script language="javascript">
alert("返回");
window.history.back(-1);
</script>第三种:
<script language="javascript">
window.navigate("top.jsp");
</script>第四种:
<script language="JavaScript">
self.location='top.htm';
</script>第五种:
<script language="javascript">
alert("非法访问!");
top.location='xx.jsp';
</script>
<form action="add_words_save.jsp(跳转的页面)" method=post>
<p>用户名:<input name="username" size="20" type="text"></p>
<p>密码:<input name="password" size="20" type="password"></p>
<P><input type="submit" value="登录"><input type="reset" value="重置"></P>
</form>