You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any way to add the value for the input field after selecting a tag from autocomplete. I tried with inputformatter. But that doesn't seem to work.
$(document).ready(function() {
var example4 = new Taggle('all_tags', {
tags: ['Try', 'entering', 'one', 'of', 'these', 'tags'],
duplicateTagClass: 'bounce'
});
var container = example4.getContainer();
var input = example4.getInput();
$(input).autocomplete({
source: function( request, response ) {
$.ajax({
url: '<?php echo base_url("URL_HERE_TO_GET_EXISTING_TAGS_FROM_SERVER") ?>',
dataType: "json",
data: {
q: request.term
},
success: function( data ) {
response( data );
}
});
},
appendTo: container,
position: { at: "left bottom", of: container },
select: function(event, data) {
event.preventDefault();
//Add the tag if user clicks
if (event.which === 1) {
let some = example4.add([data.item.label]);
example4.setOptions({
inputFormatter: function(i){
i.val(data.item.value);
}
}
)
// input.val(data.item.value);
// example4.getInput().val(data.item.value);
}
}
});
The text was updated successfully, but these errors were encountered:
Is there any way to add the value for the input field after selecting a tag from autocomplete. I tried with inputformatter. But that doesn't seem to work.
The text was updated successfully, but these errors were encountered: