解决方案 »

  1.   

    这个 我是用jquery ui里面的插件 只有firefox需要这样ie和chrome都没有问题
    <script type="text/javascript">
    $(function() {
        $( "#ranchiser_name" ).autocomplete({
            width: 300,
            max: 10,
            delay: 100,
            minLength: 1,
            autoFocus: true,
            source:function(request, response) {
            var param={}
            param['paramMap.keyword']=$("#ranchiser_name").val();
            var term = request.term;
                $.ajax({
                    url: "queryCompanyList.do",
                    dataType: "json",
                    data: param,
                   success: function(data) {
                                 response($.map(eval(data), function(item) {
                                 return {
                                  value: item.pranchiser_name,
                                     pranchiser_name:item.pranchiser_name,
                                     id: item.id
                                     };
                             }));
                         }
                     });        },
            select: function( event, ui ) {
              $("#ranchiser_id").val(ui.item.id)
             }
        });
      });
    </script>这个是我写的js
      

  2.   

    沒看到有什麽問題,幫不了你可以建個新頁面,只保留這個功能的相關JS及頁面html代碼,先排除其它可能的干擾然后再測一下看看。
      

  3.   

    谢谢你啊 
    问题找到了 需要修改js的源码
    我用的是jquery-ui-1.8.17.custom.min.js 修改后如下}).bind("keypress.autocomplete", function(a) {
    d && (d = !1, a.preventDefault())
    }).bind("focus.autocomplete", function() {
    b.options.disabled
    || (b.selectedItem = null, b.previous = b.element.val())
    }).bind("blur.autocomplete", function(a) {
    b.options.disabled
    || (clearTimeout(b.searching), b.closing = setTimeout(
    function() {
    b.close(a), b._change(a)
    }, 150))
    }).bind("input.autocomplete", function() {
        // 修复在Firefox中不支持中文的BUG
        b.search(b.item);