doucaigai7176 2014-09-08 04:42
浏览 9
已采纳

php,html,在写完第一个单词之后将选择更改为选择性,依此类推

this is the select.

<select name='select_name'>
     <option value='1'>one</option>
     <option value='2'>tow</option>
     <option value='3'>three</option>
     <option value='4'>fore</option>
    //here i have more then 300 select which i will fetch from database
</select>

i want to change it input so when i write the first later it fetch me the match items and so on if the secound later it match as i write. if is possible please write me hint so i could save my time.

for example if i write (t) it will show me

tow
three

regards

  • 写回答

1条回答 默认 最新

  • doushih06137 2014-09-08 04:48
    关注

    You're looking for a combo box. If you don't want to write it from scratch, you could use a plugin instead.

    In this example is Select2 Plugin:

    Example:

    <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/select2/3.2/select2.css" />
    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/select2/3.2/select2.min.js"></script>
    <select name='select_name' style="width:300px">
        <option value='1'>one</option>
        <option value='2'>two</option>
        <option value='3'>three</option>
        <option value='4'>four</option>
        <option value='5'>five</option>
    </select>
    <script type="text/javascript">
    $(document).ready(function(){
        $('select[name="select_name"]').select2();
    });
    </script>
    

    Demo

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度