I want to merge two plugins together.
I am using jquery autocomplete for zipcode field.
Now I want to add multiple entries for zipcode field so I found jQuery tags input plugin.
So I wnat to use jQueryUI autocomplete with jQuery tags input plugin.
I tried myself on JSfiddle but not working. link :-http://jsfiddle.net/7aDak/1719/
Can anyone help me for this functionality.
You met two problems here:
Code below is good for startpoint for you:
$('#tag1').tagsInput({
autocomplete_url:'http://ws.geonames.org/postalCodeSearchJSON',
autocomplete:{
source: function(request, response) {
$.ajax({
url: "http://ws.geonames.org/postalCodeSearchJSON",
dataType: "json",
data: {
postalcode_startsWith: request.term
},
success: function(data) {
response( $.map( data.postalCodes, function( item ) {
return {
label: item.countryCode + "-" + item.placeName,
value: item.postalCode
}
}));
}
})
}}});
http://jsfiddle.net/YGm89/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With