Andrew
asked on
jquery autocomplete forcing the user to select an item from the list
Looking for some help to force user to select an item from a jquery autocomplete textbox. What I have found doesn't seem to work for me & I am not sure why.
Here is a demo: http://members.gcp21.org/autocomplete.aspx
Here is a demo: http://members.gcp21.org/autocomplete.aspx
<script type="text/javascript">
$(document).ready(function () {
$("#dtv_Country").autocomplete({
source: function (request, response) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "autocomplete.aspx/getCountries",
data: "{'prefixText':'" + $("#dtv_Country").val() + "'}",
dataType: "json",
success: function (data) {
response(data.d);
},
error: function (result) {
alert("Error");
},
select: function (e, ui) {
$(this).next().val(ui.item.id);
},
change: function (ev, ui) {
if (!ui.item)
$(this).val("");
}
});
}
});
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
How you imagine to do this?Give us an example to help you.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry David, I accidentally selected the incorrect solution when closing...
ASKER