posts - 162,comments - 41,views - 30万

为文本框增加自动提示下拉功能,比如输入 1,则从后台数据库查询出包含1 的字段,在文本框增加下拉列表供用户选择

ajax 返回数据为搜索查询字段的json集合

复制代码
<script src="../../Scripts/JqueryUInew/jquery.autocomplete.js" type="text/javascript"></script>

    <link href="../../Scripts/JqueryUInew/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(function() {

        $("#txtCourseNameSearch").autocomplete("../AutoCompleteTextView/AutocompleteCourse.ashx?id=3", {
                dataType: "json",
                selectFirst: false,
                highlight: false,
                multiple: true,
                multipleSeparator: " ",
                scroll: true,
                scrollHeight: 300

            });
        });
        </script>
复制代码

 

posted on   高兴happy  阅读(411)  评论(0编辑  收藏  举报
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示