文章导航PC6首页软件下载单机游戏安卓资源苹果资源

pc软件新闻网络操作系统办公工具编程服务器软件评测

安卓新闻资讯应用教程刷机教程安卓游戏攻略tv资讯深度阅读综合安卓评测

苹果ios资讯苹果手机越狱备份教程美化教程ios软件教程mac教程

单机游戏角色扮演即时战略动作射击棋牌游戏体育竞技模拟经营其它游戏游戏工具

网游cf活动dnf活动lol周免英雄lol礼包

手游最新动态手游评测手游活动新游预告手游问答

您的位置:首页技术开发ASP技巧 → 关于如何动态地在同一页面实现两个<select>互传 

关于如何动态地在同一页面实现两个<select>互传 

时间:2004/11/7 4:10:00来源:本站整理作者:蓝点我要评论(0)

关于如何动态地在同一页面实现两个的值传到另一个





   

     

     

    <%  

     str="function do_select() {" & vbCrlf & _

             "if (document.form1.select1.options.length > 0) {"&vbCrlf&_

         "var j=0;"&vbCrlf&_

         "for(var i=0;i
         "if(document.form1.select1.options(i).selected) {"&vbCrlf& _

             "j=j+1; break" & vbCrlf & "}"&vbCrlf & "}"&vbCrlf& _

         "if (j > 0) {"&vbCrlf&_                    "document.form1.sel2.options[document.form1.sel2.options.length] = new Option(" &  _

              "document.form1.select1.options[document.form1.select1.selectedIndex].value,"  & _

              "document.form1.select1.options[document.form1.select1.selectedIndex].value);"& vbCrlf

    Response.Write "
"

          str=str&vbCrlf&"document.form1.select1.options[document.form1.select1.selectedIndex]=null;"&vbCrlf & _

    "if (document.form1.select1.options.length > 1) {"&vbCrlf   '&_

    str=str&vbCrlf & "}" & vbCrlf & "}" & vbCrlf& "}" & vbCrlf& "}" & vbCrlf

    Response.Write "" & vbCrlf

    Response.Write str & vbCrlf & ""& vbCrlf

              

        %>

      

    <%

    str=""

    str="function do_select2() {" & vbCrlf & _

    "if (document.form1.sel2.options.length > 0) {"&vbCrlf&_

    "var j=0;"&vbCrlf&_

    "for(var i=0;i
    "if(document.form1.sel2.options(i).selected) {"&vbCrlf& _

    "j=j+1; break" & vbCrlf & "}"&vbCrlf & "}"&vbCrlf& _

    "if (j > 0) {"&vbCrlf&_

               "document.form1.select1.options[document.form1.select1.options.length] = new Option(" &  _

              "document.form1.sel2.options[document.form1.sel2.selectedIndex].value,"  & _

              "document.form1.sel2.options[document.form1.sel2.selectedIndex].value);"& vbCrlf

           str=str&"document.form1.sel2.options[document.form1.sel2.selectedIndex] =null;" & vbCrlf &"}"& vbCrlf &"}"& vbCrlf &"}"

    Response.Write "" & vbCrlf

    Response.Write str & vbCrlf & ""& vbCrlf

    %>

       

     


  


       

     


    



    

     










      很笨吧, 哈哈!

      若那位大虾有更好的方法, 可别忘了给我寄上一份哦。

      E_Mail: fz_chenjl@163.net






相关阅读 Mac访问Windows共享文件夹Windows 7正版系统验证方法windows 8.1系统版本号查看方法Windows 8.1系统电话激活时无法输入微软返回代码解决方法Windows 8如何调整屏幕分辨率windows8.1磁盘占用100%解决方法Mac双系统如何删除Boot Camp安装的Windows分区Apple教你如何在Mac 上运行 Windows

文章评论
发表评论

热门文章 没有查询到任何记录。

最新文章 VB.NET 2005编写定时关 Jquery get/post下乱码解决方法 前台gbk gb如何使用数据绑定控件显示数据ASP脚本循环语句ASP怎么提速

人气排行 轻松解决"Server Application Error"和iis"一起学习DataGridView调整列宽用ASP随机生成文件名的函数Jquery get/post下乱码解决方法 前台gbk gbODBC Drivers错误80004005的解决办法返回UPDATE SQL语句所影响的行数的方法用Javascript隐藏超级链接的真实地址两个不同数据库表的分页显示解决方案