我的意思是:既可从下拉菜单选取,又可从下拉菜单处直接输入。

解决方案 »

  1.   

    用struts2的标签<s:combobox>
    现成的,直接生成一个单行文本框和下拉别表的组合。
      

  2.   

    combox ?
    以前写过以个,直接支持xml的。
    这种东西不难,建议楼主自己写一个,这样才有乐趣啊...呵呵。
      

  3.   


    用这个吧,现成的。只要在项目中加入struts2的jar包,然后在jsp页面头部加上<%@ taglib prefix="s" uri="/struts-tags"%>就可以用了。
      

  4.   

    给个例子,实现原理:div 加onchange事件
    <div style="position:relative;">
    <span style="margin-left:100px;width:18px;overflow:hidden;">
    <select style="width:118px;margin-left:-100px" onchange="this.parentNode.nextSibling.value=this.value">
    <option value="汽车">汽车 </option>
    <option value="火车"> 火车 </option>
    <option value="飞机"> 飞机 </option>
    <option value="飞机"> 飞机 </option>
    <option value="飞机"> 飞机 </option>
    <option value="飞机"> 飞机 </option>
    </select></span><input name="box" style="width:100px;position:absolute;left:0px;">
    </div> 
      

  5.   

    可以参考一下body><span style="absolute;margin-top:-12px;">
    <table cellspacing="0" cellpadding="0" width="100%" border="0">
    <tr>
    <td align="left">
    <span style="position:absolute;border:1pt solid #c1c1c1;overflow:hidden;width:188px;height:19px;clip:rect(-1px 190px 190px 170px);">
    <select name="aabb" id="aabb" style="width:190px;height:20px;margin:-2px;" onChange="changeF();">
    <option value="" style="color:#c2c2c2;">---请选择---</option>
    <option value="闲人书库">闲人书库</option>
    <option value="闲人BLOG">闲人BLOG</option>
    <option value="<a href="http://www.ayinsky.com" target="_blank">闲人设计</a>"><a href="http://www.ayinsky.com" target="_blank">闲人设计</a></option>
    <option value="闲人软件">闲人软件</option>
    </select>
    </span>
    <span style="position:absolute;border-top:1pt solid #c1c1c1;border-left:1pt solid #c1c1c1;border-bottom:1pt solid #c1c1c1;width:170px;height:19px;">
    <input type="text" name="ccdd" id="ccdd" value="可选择也可输入的下拉框" style="width:170px;height:15px;border:0pt;">
    </span>
    </td>
    </tr>
    </table>
    </span></body>
    <script language="javascript">
    function changeF()
    {
    // 从下面的赋值可以的值,你在action 中只要得到name =“ccdd” 的值就可以了。
    document.getElementById('ccdd').value=document.getElementById('aabb').options[document.getElementById('aabb').selectedIndex].value;
    }
    </script>
    </html>
      

  6.   

    今天看了以前的一些 csdn 的老帖子,那些牛人,现在也不知道到哪里去潇洒了。
    而且,以前的问题总会争一个没完没了,现在,这种现象,可太少了。
      

  7.   

    有些问题,你确实可以 google .
    能自己解决,就自己解决。