asp+access 三级联动下拉菜单的问题
代码只能显示二级联动,现在想加一个三级的,怎么添加?望指教!以下是原来二级的js代码:<scriptID="clientEventHandlersJS"LANGUAGE=...
代码只能显示二级联动,现在想加一个三级的,怎么添加?望指教!
以下是原来二级的js代码:
<script ID="clientEventHandlersJS" LANGUAGE="javascript">
<!--
function select_type()
{
var pid = form1.pid.options(form1.pid.selectedIndex).value;
if (pid != "")
{
//Clear major List
for(var i=form1.cid.options.length-1;i>=0;--i)
{
form1.cid.options.remove(i)
}
var oXMLDoc = new ActiveXObject('MSXML');
var sURL= "get_type.asp?pid="+pid;
oXMLDoc.url = sURL;
var oRoot=oXMLDoc.root;
if(oRoot.children != null)
{
for(var i=0;i<oRoot.children.length;i=i+2)
{
oItem = oRoot.children.item(i);
oItemvalue=oRoot.children.item(i+1);
sName = oItem.text;
sValue = oItemvalue.text;
var oOption = document.createElement('OPTION');
oOption.text = sName;
oOption.value = sValue;
form1.cid.options.add(oOption);
}
}
}
}
-->
</script>
<script ID="clientEventHandlersJS" LANGUAGE="javascript">
<!--
function select_type1()
{
var pid = form1.cid.options(form1.cid.selectedIndex).value;
if (pid != "")
{
//Clear major List
for(var i=form1.sid.options.length-1;i>=0;--i)
{
form1.sid.options.remove(i)
}
var oXMLDoc = new ActiveXObject('MSXML');
var sURL= "get_type1.asp?pid="+pid;
oXMLDoc.url = sURL;
var oRoot=oXMLDoc.root;
if(oRoot.children != null)
{
for(var i=0;i<oRoot.children.length;i=i+2)
{
oItem = oRoot.children.item(i);
oItemvalue=oRoot.children.item(i+1);
sName = oItem.text;
sValue = oItemvalue.text;
var oOption = document.createElement('OPTION');
oOption.text = sName;
oOption.value = sValue;
form1.sid.options.add(oOption);
}
}
}
}
-->
</script> 展开
以下是原来二级的js代码:
<script ID="clientEventHandlersJS" LANGUAGE="javascript">
<!--
function select_type()
{
var pid = form1.pid.options(form1.pid.selectedIndex).value;
if (pid != "")
{
//Clear major List
for(var i=form1.cid.options.length-1;i>=0;--i)
{
form1.cid.options.remove(i)
}
var oXMLDoc = new ActiveXObject('MSXML');
var sURL= "get_type.asp?pid="+pid;
oXMLDoc.url = sURL;
var oRoot=oXMLDoc.root;
if(oRoot.children != null)
{
for(var i=0;i<oRoot.children.length;i=i+2)
{
oItem = oRoot.children.item(i);
oItemvalue=oRoot.children.item(i+1);
sName = oItem.text;
sValue = oItemvalue.text;
var oOption = document.createElement('OPTION');
oOption.text = sName;
oOption.value = sValue;
form1.cid.options.add(oOption);
}
}
}
}
-->
</script>
<script ID="clientEventHandlersJS" LANGUAGE="javascript">
<!--
function select_type1()
{
var pid = form1.cid.options(form1.cid.selectedIndex).value;
if (pid != "")
{
//Clear major List
for(var i=form1.sid.options.length-1;i>=0;--i)
{
form1.sid.options.remove(i)
}
var oXMLDoc = new ActiveXObject('MSXML');
var sURL= "get_type1.asp?pid="+pid;
oXMLDoc.url = sURL;
var oRoot=oXMLDoc.root;
if(oRoot.children != null)
{
for(var i=0;i<oRoot.children.length;i=i+2)
{
oItem = oRoot.children.item(i);
oItemvalue=oRoot.children.item(i+1);
sName = oItem.text;
sValue = oItemvalue.text;
var oOption = document.createElement('OPTION');
oOption.text = sName;
oOption.value = sValue;
form1.sid.options.add(oOption);
}
}
}
}
-->
</script> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询