zoukankan      html  css  js  c++  java
  • 用Javascript获取select的值 yangan

     <script type="text/javascript">
     function GetValue()
     {
      var strUrl;  
      strUrl=window.document.getElementById("friendLink").value;
      
      window.open("http://22+strurl/);  
       
     }
    </script>

    //根据链接类型读取数据库中的数据

            public static string GetLink(string type)
            {
                string sqlTemp = "select * from shang_cms_friends where lianjie_pic ='" + type + "'";
                DataSet ds = SQLHelper.DataAdapter(sqlTemp, SQLHelper.SDACmd.select, "sqlIndex");

                string link = null;
                string strSelectStart = "<select id=friendLink name=friendLink style=275px;height:27px; onChange=javascript:GetValue(); >";
                if (type == "0")
                {
                    link = strSelectStart + "<option selected=selected>--------友情链接--------</option>";
                }
                else
                {
                    link = strSelectStart + "<option selected=selected>--------子公司链接--------</option>";
                }

                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {

                    link += "<option value="+ds.Tables[0].Rows[i]["lianjie_url"].ToString()+">" + ds.Tables[0].Rows[i]["lianjie_name"].ToString() + "</option>";
                }

                link += "</select>";

                return link;

               // <select id="friendLink" name="friendLink" style=" 275px; height: 27px;">
                 //       <option selected="selected">--------友情链接--------</option>
                 //   </select>
            }

  • 相关阅读:
    http://blog.csdn.net/jyw935478490/article/details/51233931
    http://www.roncoo.com/article/detail/124661
    http://blog.csdn.net/chenleixing/article/details/43740759
    http://www.xttblog.com/?p=794
    http://jingyan.baidu.com/article/2009576193ee38cb0721b416.html
    Java 生成16/32位 MD5
    AI(Adobe Illustrator)简单入门——骷髅
    AI(Adobe Illustrator)简单入门——米老鼠
    ovirt-engine安装
    service postgresql initdb [FAILED]
  • 原文地址:https://www.cnblogs.com/xlx0210/p/1519928.html
Copyright © 2011-2022 走看看