页面中有个籍贯的输入表单,
点击输入框旁的一个按钮或者链接弹出一个页面显示籍贯的结构,
可以直接双击选择相应的籍贯名称。
请问这个功能用什么方法可以实现呢?
或者能给出个例子,谢谢!

解决方案 »

  1.   

    ajax,定位一个层,层上显示提示信息,在层上写上双基事件,基本就可以了 
      

  2.   

    <html>
    <head>
        <script>
    function tableClicked(e)
    {
    //e=e?e:window.event;
    document.getElementById("ms").value=(e.srcElement?e.srcElement.innerHTML:e.target.textContent);
    document.all.Layer2.style.display='none';
    document.all.ly.style.display="none";
    }
      function locking(){   
      document.all.ly.style.display="block";   
      document.all.ly.style.width=document.body.clientWidth;   
      document.all.ly.style.height=document.body.clientHeight;   
      document.all.Layer2.style.display='block';   
      }     
        </script></head>
    <body>
     <input id="ms" type="text"/>
         <input type="button" value="查询" onclick="locking()">
        <div id="ly" style="position: absolute; top: 0px; filter: alpha(opacity=60); background-color: #777;
            z-index: 2; left: 0px; display: none;">
        </div>
        <!--浮层框架开始-->
        <div id="Layer2" align="center" style="position: absolute; z-index: 10; left: expression((document.body.offsetWidth-540)/2); top: expression((document.body.offsetHeight-170)/2);
            background-color: #fff; display: none;" >
            <table width="540" border="0" cellpadding="0" cellspacing="0" style="border: 0   solid   #e7e3e7;
                border-collapse: collapse">
    <caption>
    <div align="left" style="background-color: #73A2d6; color: #fff; padding-left: 4px; padding-top: 2px;
    font-weight: bold; font-size: 14px;" width="100%" height="20" valign="middle">
    媒体管理IP
    </div>
    </caption>
    <table width="" onclick="tableClicked(event)">
    <tbody align="left">
    <tr>
    <td>192.168.0.1</td> 
    <td>192.168.0.2</td>
    <td>192.168.0.3</td>
    <td>192.168.0.4</td>
    </tr>
    </tbody>
    </table>
            </table>
        </div>
        <!--浮层框架结束-->
    </body>
    </html>