javascript 无法获取未定义或 null 引用的属性“sf”什么情况求解答
<formname="form9"class="form-horizontal"action=""><formaction=""method="post"name="fo...
<form name="form9" class="form-horizontal" action="">
<form action="" method="post" name="form2"> <select id="sf" size="5" name="sf" onchange="changecity()"> <option selected=“selected”>选择省份</option> <option value="北京">北京</option> <option value="江苏省">江苏省</option>
</select> <SELECT size="5" name=city style="width:80"> <OPTION>==所在城市==</OPTION> </SELECT> </form>
</form>
function changecity(){ index = form9.form2.sf.options.selectedIndex - 1; form2.city.length = city[index].length; for (var i = 0; i < city[index].length; i++) { var text = city[index][i].split("-"); form2.city.options[i].text = text[0]; form2.city.options[i].value = text[1]; }} 展开
<form action="" method="post" name="form2"> <select id="sf" size="5" name="sf" onchange="changecity()"> <option selected=“selected”>选择省份</option> <option value="北京">北京</option> <option value="江苏省">江苏省</option>
</select> <SELECT size="5" name=city style="width:80"> <OPTION>==所在城市==</OPTION> </SELECT> </form>
</form>
function changecity(){ index = form9.form2.sf.options.selectedIndex - 1; form2.city.length = city[index].length; for (var i = 0; i < city[index].length; i++) { var text = city[index][i].split("-"); form2.city.options[i].text = text[0]; form2.city.options[i].value = text[1]; }} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询