ASP中实现下拉菜单联动
1. asp+jquery实现下拉菜单联动,代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script src="js/jquery-1.7.2.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function()
{
$("#caozuo").click(function()
{
if($("#caozuo").val()=='暂停办理')
{
$("#renyuan").hide();
}
if($("#caozuo").val()=='文稿拟办')
{
$("#renyuan").show();
$("#submit").show();
}
if($("#caozuo").val()=='-1')
{
$("#renyuan").hide();
$("#submit").hide();
}
})
});
</script>
</head>
<body>
<table width="618" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="60"> </td>
</tr>
</table>
<table width="618" border="1" cellspacing="0" cellpadding="0" align="center">
<tr bgcolor="#CCCCCC">
<td>
<select id="caozuo">
<option value="-1">-请选择-</option>
<option value="文稿拟办">文稿拟办</option>
<option value="暂停办理">暂停办理</option>
</select>
<select id="renyuan" >
<option>张三</option>
<option>李四</option>
<option>王五</option>
</select>
<input type="submit" value="确定" id="submit" />
</td>
</tr>
</table>
</body>
</html>
2. asp+javasript实现下拉菜单联动,代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script src="js/jquery-1.7.2.js"></script>
html下拉菜单的制作方法<script language="javascript" type="text/javascript">
function xuanze(caozuo)
{
if(caozuo.value=='暂停办理')
{
ElementById("renyuan").style.display="none";
ElementById("queding").style.display="";
}
if(caozuo.value=='文稿拟办')
{
ElementById("renyuan").style.display="";
ElementById("queding").style.display="";
}
if(caozuo.value=='-1')
{
ElementById("renyuan").style.display="none";
ElementById("queding").style.display="none"
}
}
</script>
</head>
<body>
<table width="618" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="100"> </td>
</tr>
</table>
<table width="618" border="1" cellspacing="0" cellpadding="0" align="center">
<tr bgcolor="#eeeeee">
<td height="25">
<select id="caozuo" onchange="xuanze(caozuo)">
<option value="-1">-请选择-</option>
<option value="文稿拟办">文稿拟办</option>
<option value="暂停办理">暂停办理</option>
</select>
<select id="renyuan" >
<option>张三</option>
<option>李四</option>
</select>
<input type="submit" value="确定" id="queding" />
</td>
</tr>
</table>
</body>
</html>
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论