给函数取名时不要加"[]"符
-----------------------------------
错了,应该是控件名:)   <SELECT name=sheng_from[] 就是这个!

解决方案 »

  1.   

    报错? 有什么错误?你的js代码不全,在贴点出来看看.你<SELECT name=sheng_from[] 这个是做什么用的?
      

  2.   

    两个的话就是一个数组,比方说<select name=sheng><select name=sheng>则document.all.sheng[0]代表第一个,document.all.sheng[1]代表第二个
      

  3.   

    对呀,你这么用是对的,但是你取名的时候不能写<SELECT name=sheng_from[]>呀,
    sheng_from[0]是在js里面用的
     在这个方法里调用的时候你可以加上 i 
    mainareaC(document.thisForm.sheng_from[i-1],document.thisForm.shi_from[i-1]);
    这样是可以的.
    但记住,i是从1开始的
      

  4.   

    用elements数组方式来取带有无效字符名称的element元素如下:<form name="thisForm">
    <SELECT name="sheng_from[]">
    <option value=1>1</option>
    <option value=2>2</option>
    </select>
    <SELECT name="sheng_from[]">
    <option value=a>a</option>
    <option value=b>b</option>
    </select>
    <br>
    <button onclick="alert(document.thisForm.elements['sheng_from[]'].item(0).value)">第一个sheng_from列表的值</button>
    <br>
    <button onclick="alert(document.thisForm.elements['sheng_from[]'].item(1).value)">第二个sheng_from列表的值</button>
    </form>
      

  5.   

    <script>
    document.write("<script>alert('test')</scr"+"ipt>")
    </script>嵌套 javascript
      

  6.   

    to  kisslan(郁忧的曼陀萝) :
    js的主要部分是:
    function mainareaC(mainlocation,sublocation){
    changelocation(mainlocation,sublocation,1);
    itemvalue=mainlocation.options [mainlocation.selectedIndex].value;
    sublocation.value=itemvalue;
    }
    function subareaB(mainlocation,sublocation){ for(i=sublocation.selectedIndex;i>=0;i--){
    if(sublocation.options[i].text.indexOf("├",0)==-1 && sublocation.options[i].text.indexOf("└",0)==-1){
    mainlocation.value=sublocation.options[i].value;
    break;
    }
    }
    }
    还有其他,太多了,功能是连动菜单,谢谢各位的提醒,我采用两个变量结合的方法还可以解决,数组方面有时间再探讨一下)::