管理员权限实现,普通管理员没有添加管理员权限,超级管理员可以添加管理员。
想实现当add.jsp页面中id="cjgly"时执行list.jsp页面的id="cjtj",当add.jsp页面中id="ptgly"时执行list.jsp页面的id="pttj";
这样能实现吗?应该怎么做?看见的大佬能给点意见吗?谢谢
list.jsp
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<TITLE>管理员账号查询</TITLE>
<link rel="stylesheet" href="images/hsgcommon/common.css" type="text/css">
<link rel="stylesheet" href="images/hsgcommon/div.css" type="text/css">
<script type="text/javascript" src="scripts/jquery.min.js"></script>
<script type="text/javascript" src="scripts/cookie_util.js"></script>
<script type="text/javascript">
$(function(){
$("#")
});
</script>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
-->
</style>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td>
<table width="100%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#aec3de">
<tr align="left" bgcolor="#F2FDFF">
<td colspan="17" background="images/table_header.gif">管理员账户列表</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td bgcolor="#FFFFFF">
<table width="100%" border="1" align="center" cellpadding="4" cellspacing="1" bgcolor="#aec3de">
<tr align="right" bgcolor="#ebf0f7">
<td colspan="21">
<table width="100%" border="0" align="center" cellpadding="4" cellspacing="1" >
<tr align="left" >
<td colspan="17">
<form action="allusersList.do" name="myform" method="post">
账号:<input name="username" type="text" id="username" class="form-control2" />
<input type="submit" value="查询" class="btn btn-info btn-small"/>
<div id="pttj">
<input type="button" name="Submit" value="添加" class="btn btn-info btn-small" onclick="javascript:location.href='allusers_add.jsp';" disabled="disabled"/>
</div>
<div id="cjtj">
<input type="button" name="Submit" value="添加" class="btn btn-info btn-small" onclick="javascript:location.href='allusers_add.jsp';" />
</div>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
===============
add.jsp
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<script type="text/javascript" src="js/My97DatePicker/WdatePicker.js" charset="gb2312"></script>
<script type="text/javascript" src="js/popup.js"></script>
<script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<TITLE>添加管理员账户</TITLE>
<link rel="stylesheet" href="images/hsgcommon/common.css" type="text/css">
<link rel="stylesheet" href="images/hsgcommon/div.css" type="text/css">
</head>
<%
String id="";
%>
<script language="javascript">
function gows()
{
document.location.href="allusers_add.jsp?id=<%=id%>";
}
function hsgxia2shxurxu(nstr,nwbk)
{
if (eval("form1."+nwbk).value.indexOf(nstr)>=0)
{
eval("form1."+nwbk).value=eval("form1."+nwbk).value.replace(nstr+";", "");
}
else
{
eval("form1."+nwbk).value=eval("form1."+nwbk).value+nstr+";";
}
}
</script>
<body>
<form action="addAllusers.do" name="form1" method="post">
<table width="100%" border="1" align="center" cellpadding="3" cellspacing="1" style="border-collapse:collapse" bgcolor="#F2FDFF">
<tr bgcolor="#E7E7E7">
<td height="20" colspan="2" background="images/table_header.gif">添加管理员账户</td>
</tr>
<tr >
<td width="200">用户名:</td>
<td>
<input name='username' type='text' id='username' value='' onblur='hsgcheck()' class="form-control" /> *<label id='clabelusername' style="margin-top:16px;" />
</td>
</tr>
<tr >
<td width="200">密码:</td>
<td>
<input name='pwd' type='text' id='pwd' value='' onblur='checkform()' class="form-control" /> *<label id='clabelpwd' style="margin-top:16px;" />
</td>
</tr>
<tr >
<td width="200">权限:</td>
<td>
<select name="cx" id="cx" class="form-control">
<div id="ptgly"><option value="普通管理员">普通管理员</option></div>
<div id="cjgly"><option value="超级管理员">超级管理员</option></div>
</select>
</td>
</tr>
<tr align='center' height="22">
<td width="25%" height="45" align="right"> </td>
<td width="75%" height="45" align="left">
<input type="submit" name="querenzhuce" id="querenzhuce" value="提交" onClick="return checkform();" class="btn btn-info btn-small" />
<input type="reset" value="重置" class="btn btn-info btn-small" />
</td>
</tr>
</table>
</form>
</body>
</html>