Jquery Autocomplete Unable to Empty Input on Internet Explorer
Posted
by Matias
on Stack Overflow
See other posts from Stack Overflow
or by Matias
Published on 2010-04-12T20:33:36Z
Indexed on
2010/04/12
20:53 UTC
Read the original article
Hit count: 345
jQuery
|autocomplete
Hi,
I´ve got a Jquery autocomplete input like the following:
$("#cities").autocomplete(regionIDs, {
minChars: 2,
width: 310,
autoFill: true,
matchContains: "word",
formatItem: function(row) {
return row.city + ", " + "<span>" + row.country + "</span>";
},
formatMatch: function(row) {
return row.city;
},
formatResult: function(row) {
return row.city + ", " + row.country;
}
});
A listener for the input
$("#cities").result(function(event, data, formatted) {
selectedCity = (data.regionID);
});
And the input:
<input type="text" class="textbox" id="cities" name="q" autocomplete="off">
The trouble is when I reload the page, Internet explorer displays last user Input in the text box. However, the variable has no value.
I have tried with .reset() but no success.
Any ideas why ?
© Stack Overflow or respective owner