backspace key press on Jquery ui Autocomplete textbox doesn't remove any letters on it?
This is my text field for which i am uisng Autocomplete .
- <input type="text" name="state" id="state" placeholder="State" maxlength="25" required onkeypress="return nospecialCharacters(event)"/>
$("#state").autocomplete({
source: function(request, response) {
var statevalue = $.trim($("#state").val());
if (statevalue) {
$.ajax({
url: url + 'eee',
dataType: 'jsonp',
jsonp: false,
timeout: 6000,
jsonpCallback: 'jsonCallback',
delay: 100,
success: function(data) {
$("#state").empty();
response(data);
}
});
}
},
minLength: 2,
appendTo: "#state_result",
select: function (event, ui) {
$("#state").val(ui.item.label);
$("#city").focus();
return false;
},
close: function(event, ui)
$(this).data().term = null;
});
Everything works fine , but the issue i am facing is that when some selection is made on the textinput and try to do a backspace , it doesn't remove any characters (I guess its making requests , so it keep on updating the box)
Could you please let me know how to resolve this ??