1.仿51jobçå¸äºçº§èå¨
仿51jobçå¸äºçº§èå¨
æ两ç§ï¼ä¸ç§ç¨DROPDOWNLISTèªå¸¦äºä»¶onSelectedChangedå®ç°çï¼ä½æ¯é¡µé¢æå·æ°çï¼ä¸ç§ç¨javascriptäºå®¢æ·ç«¯å®ç°ï¼æ å·æ°ã
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebApplication.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="/intellisense/ie5" name="vs_targetSchema">
<script language="JavaScript">
//å®ä¹äºåå¸çäºç»´æ°ç»ï¼éé¢ç顺åºè·ç份ç顺åºæ¯ç¸åçãéè¿selectedIndexè·å¾ç份çä¸æ å¼æ¥å¾å°ç¸åºçåå¸æ°ç»
var city=[
["å京",联动联动android关闭屏幕源码"天津","ä¸æµ·","éåº"],
["å京","èå·","åé","常å·"],
["ç¦å·","ç¦å®","é¾å²©","åå¹³"],
["广å·","æ½®é³","æ½®å·","æ¾æµ·"],
["å °å·","ç½é¶","å®è¥¿","æ¦ç "]
];
function getCity(){
//è·å¾ç份ä¸ææ¡ç对象
var sltProvince=document.getElementById("province");
//è·å¾åå¸ä¸ææ¡ç对象
var sltCity=document.getElementById("city");
//å¾å°å¯¹åºç份çåå¸æ°ç»
var provinceCity=city[sltProvince.selectedIndex];
//æ¸ ç©ºåå¸ä¸ææ¡ï¼ä» çæ示é项
sltCity.length=0;
//å°åå¸æ°ç»ä¸çå¼å¡«å å°åå¸ä¸ææ¡ä¸
for(var i=0;i<provinceCity.length;i++){
sltCity[i]=new Option(provinceCity[i],provinceCity[i]);
}
}
</script>
</HEAD>
<BODY>
<FORM name="form1" action="" method="post" runat="server">
<asp:dropdownlist id="province" Runat="server">
<asp:ListItem Value="ç´è¾å¸" Selected="True">ç´è¾å¸</asp:ListItem>
<asp:ListItem Value="æ±è">æ±è</asp:ListItem>
<asp:ListItem Value="ç¦å»º">ç¦å»º</asp:ListItem>
<asp:ListItem Value="广ä¸">广ä¸</asp:ListItem>
<asp:ListItem Value="çè">çè</asp:ListItem>
</asp:dropdownlist><asp:dropdownlist id="city" Runat="server">
<asp:ListItem Value="å京" Selected="True">å京</asp:ListItem>
<asp:ListItem Value="天津">天津</asp:ListItem>
<asp:ListItem Value="ä¸æµ·">ä¸æµ·</asp:ListItem>
<asp:ListItem Value="éåº">éåº</asp:ListItem>
</asp:dropdownlist>
<P><FONT face="å®ä½"><INPUT type="hidden" runat="server" id="h1"></FONT></P>
<P><FONT face="å®ä½"><INPUT type="hidden" runat="server" id="h2"></FONT></P>
</FORM>
</BODY>
</HTML>
(å¨åå°ä¸éè¦æ·»å this.province.Attributes["onclick"]="javascript:return getCity();";ï¼