Question

Jquery ui auto-complete is not working properly in IE8.I'm getting the value when start typing but after select the value,its not closing drop-down in IE8.But its working good in Firefox and IE9. Could please help me what is the issue here.

$("#ordernumber").autocomplete({       
    source: function(request, response) {
    $.ajax({
    url: "searchOrder.jsp",
    type: "POST",
    dataType: "json",    
    data: { part: request.term,},           
    success: function (data) {
             response($.map(data, function (value, key) {
             return {
                    label: key+","+value,
                    value: key,
                    desc : value  
                };
            }));
            }
          });
    },
    minLength: 3,
    select: function (event, ui) {
    $('#ordername').val(ui.item.desc);
    $('#ordername').text(ui.item.desc);
    }  
    });  

I'm selecting the order number and ordername is going populate automatically in another text box.Its working good in firefox and IE9.

Please see the below code in where getting error in jquery.

jquery.min.js

jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},

var t=Lt(this,e);t.appendChild(e)

Its stop the process in t.appendChildmethod. Please advise what is the problem here.

jquery version :

Was it helpful?

Solution

I suppose to use .val , but i have using both .val & .text.This cause the IE error.

select: function (event, ui) {
    $('#ordername').val(ui.item.desc);
   // $('#ordername').text(ui.item.desc);
    } 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top