我的联动列表是:
<script language="javascript">
//构造数据结构
var dropArray = new Array(2);
var childArray1 = new Array(3);
var childArray2 = new Array(2);
function dataObject(aChildId, aText) {
this.childId = aChildId;
this.text = aText;
}
function arrayObject(aParentId, aArray) {
this.parentId = aParentId;
this.array = aArray;
}
childArray1[0] = new dataObject("cs","长沙");
childArray1[1] = new dataObject("sy","邵阳");
childArray1[2] = new dataObject("xt","湘潭");
childArray2[0] = new dataObject("km","昆明");
childArray2[1] = new dataObject("bn","西双版纳");
dropArray[0] = new arrayObject("hn",childArray1);
dropArray[1] = new arrayObject("yn",childArray2);
function cascadeDrop(srcSelect, destSelect) {
var parentValue = srcSelect.options[srcSelect.selectedIndex].value;
if(parentValue != "") {//如果没有选择主下拉框中的元素.
for(var i = 0; i < dropArray.length; i++) {
if(parentValue == dropArray[i].parentId) {
destSelect.options.length = 0;//清空联动下拉框.
var destArray = dropArray[i].array;
for(var j = 0; j < destArray.length; j++) {
var destValue = destArray[j].childId;
var destText = destArray[j].text;
destSelect.options[j] = new Option(destText, destValue);
}
}
}
} else {
destSelect.options.length = 0;//清空联动下拉框.
destSelect.options[0] = new Option(" - None selected - ","");
}
}
</script>在修改记录时怎么让默认值为数据库记录
<select style="width=150" onChange="cascadeDrop(this, city)">
<option value=""> - None selected - </option>
<option value="hn"<%if rs("netz_info_mtype")="湖南" then response.write("selected") end if%>> 湖南</option>
<option value="yn"<%if rs("netz_info_mtype")="云南" then response.write("selected") end if%>>云南</option>
</select>后面的这联动列表的值怎么写 <select name="stype" id="stype" style="width=150">
<option value="">请选择信息栏目</option>
<option value=""></option>
</select>
<script language="javascript">
//构造数据结构
var dropArray = new Array(2);
var childArray1 = new Array(3);
var childArray2 = new Array(2);
function dataObject(aChildId, aText) {
this.childId = aChildId;
this.text = aText;
}
function arrayObject(aParentId, aArray) {
this.parentId = aParentId;
this.array = aArray;
}
childArray1[0] = new dataObject("cs","长沙");
childArray1[1] = new dataObject("sy","邵阳");
childArray1[2] = new dataObject("xt","湘潭");
childArray2[0] = new dataObject("km","昆明");
childArray2[1] = new dataObject("bn","西双版纳");
dropArray[0] = new arrayObject("hn",childArray1);
dropArray[1] = new arrayObject("yn",childArray2);
function cascadeDrop(srcSelect, destSelect) {
var parentValue = srcSelect.options[srcSelect.selectedIndex].value;
if(parentValue != "") {//如果没有选择主下拉框中的元素.
for(var i = 0; i < dropArray.length; i++) {
if(parentValue == dropArray[i].parentId) {
destSelect.options.length = 0;//清空联动下拉框.
var destArray = dropArray[i].array;
for(var j = 0; j < destArray.length; j++) {
var destValue = destArray[j].childId;
var destText = destArray[j].text;
destSelect.options[j] = new Option(destText, destValue);
}
}
}
} else {
destSelect.options.length = 0;//清空联动下拉框.
destSelect.options[0] = new Option(" - None selected - ","");
}
}
</script>在修改记录时怎么让默认值为数据库记录
<select style="width=150" onChange="cascadeDrop(this, city)">
<option value=""> - None selected - </option>
<option value="hn"<%if rs("netz_info_mtype")="湖南" then response.write("selected") end if%>> 湖南</option>
<option value="yn"<%if rs("netz_info_mtype")="云南" then response.write("selected") end if%>>云南</option>
</select>后面的这联动列表的值怎么写 <select name="stype" id="stype" style="width=150">
<option value="">请选择信息栏目</option>
<option value=""></option>
</select>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货