jsp通过选中radio进入不同的form.action


	<script>

		function sentWord() {
			targetForm = document.forms[0];
			targetForm.action = "searchSentResult.jsp";
		}
		function sensitiveWord() {
			targetForm = document.forms[0];
			targetForm.action = "searchSensitiveWordResult.jsp";
		}
		function hotWord() {
			targetForm = document.forms[0];
			targetForm.action = "searchHotWordResult.jsp";
		}
	</script>
	
<input type="radio" name="kind" value="1"checked="checked" οnclick="sentWord()"/>情感词库 
				    <input type="radio" name="kind"value="2" οnclick="sensitiveWord()"/>敏感词库 
				    <input type="radio" name="kind" value="3" οnclick="hotWord()"/>热度词库

radio的选中通过onclick进入相应的script,由下面的语句

targetForm.action = "searchSensitiveWordResult.jsp";
转到另一个网页。

<%@page import="javax.swing.text.Document"%>
<%@ page contentType="text/html; charset=gb2312"%>
<%
	session.invalidate();
%>
<%@ page import="cwsBean.*"%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<LINK href="hellking2.css" type=text/css rel=stylesheet>

<body>
	<script>

		function sentWord() {
			targetForm = document.forms[0];
			targetForm.action = "searchSentResult.jsp";
		}
		function sensitiveWord() {
			targetForm = document.forms[0];
			targetForm.action = "searchSensitiveWordResult.jsp";
		}
		function hotWord() {
			targetForm = document.forms[0];
			targetForm.action = "searchHotWordResult.jsp";
		}
	</script>
	<center>
		<hr>
		<form name="form1" action="searchSentResult.jsp" method="get">
			<table width="50%" border="1">
				</tr>
				<tr bgcolor="#336600">
					<td align="add" colspan="2">
					<input type="submit" value="search"> 
					<input type="text"name="name"value="<%=request.getParameter("name") == null ? "" : request
					.getParameter("name")%>"style="width: 234px; "></td>
				</tr>
			</table>
			<tr align="center">
				<td><input type="radio" name="kind" value="1"checked="checked" οnclick="sentWord()"/>情感词库 
				    <input type="radio" name="kind"value="2" οnclick="sensitiveWord()"/>敏感词库 
				    <input type="radio" name="kind" value="3" οnclick="hotWord()"/>热度词库
				</td>
			</tr>
		</form>
	</center>
</body>
</html>



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值