• 动态添加Select~


    <script>
        var kindType=new Array()

    </script>

    <%
     '创建材料类别下拉框
     sql2="select * from material_kind_t where isvalid='1'"
     set rs2=server.createobject("ADODB.Recordset")
     rs2.open sql2,conn,1,1
     typeLen=rs2.recordcount
     '''response.Write(typeLen-1)
     do while not rs2.eof
    %>

    <script>

        kindType.push('<%=rs2.fields("kindName")%>') 
    </script>

    ===============================================================

     kindLen1=document.all("supplierName").length-1
       if (kindLen1==0)
       {
        for(i=0;i<=kindType1.length-1;i++)  
         {
           var oOption=document.createElement("OPTION");  
           document.all("supplierName").options.add(oOption);  
           oOption.innerText =kindType1[i]  
           oOption.value=kindType1[i];
         }
       }else
        {
        ///alert(document.add_f.kindname.length);
        for(i=0;i<=kindType1.length-1;i++)  
         {
           var oOption=document.createElement("OPTION");  
           document.all("supplierName")[kindLen1].options.add(oOption);  
           oOption.innerText =kindType1[i]  
           oOption.value=kindType1[i];
           //alert(kindType[i])
         }
        }

  • 相关阅读:
    汇编-实验9
    Starling开源手势库AcheGesture
    Robotlegs2的Starling扩展
    Flash Builder 4.6/4.7 注释以及字体大小修改
    js中函数的理解
    js对象引用赋值后
    var声明提前 undefined
    光棍节程序员闯关秀
    body和普通div背景图宽高百分比的区别
    笔试题
  • 原文地址:https://www.cnblogs.com/AriLee/p/1999273.html
Copyright © 2020-2023  润新知