changestate.jsp

来自「java带进度条上传尽量不要让站长把时间都花费在为您修正说明上」· JSP 代码 · 共 35 行

JSP
35
字号
<%@ page language="java" pageEncoding="gb2312"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%> 
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
 
<html> 
	<head>
		<title>JSP for UsersForm form</title>
	</head>
	<body onload="selectState()">
	<%
		int sta=Integer.valueOf(request.getParameter("state"));
	%>
		<html:form action="/users.do?method=changeState">
			修改状态 : <html:select property="state">
				<option value="<%=sta %>" id="sta" ></option>
				<option value="1" id="t1" >正常状态</option>
				<option value="2" id="t2" >禁止状态</option>
			</html:select><html:errors property="state"/>
			<br/>
			<html:hidden property="uid" value="<%=request.getParameter("uid") %>"/>
			<html:submit/><html:cancel/>
		</html:form>
	</body>
	<script type="text/javascript">
		function selectState(){
			var sta=document.getElementById("sta").value;
			if(sta=1)
				t1.selected="selected";
			else if(sta=2)
				t2.selected="selected";
		}
	</script>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?