mdbootstrap / bootstrap-templates

A collection of free Bootstrap 5 templates.
https://mdbootstrap.com/freebies/
3.07k stars 1.02k forks source link

add method not working #602

Closed balabp closed 2 years ago

balabp commented 7 years ago

add/remove method when using javascript to add tags is not working. It creates a new input tag every time image

macwac commented 7 years ago

did you have any error in console?

balabp commented 7 years ago

below is the error -

screen shot 2017-07-09 at 1 46 40 pm
macwac commented 7 years ago

ok first try to define taginputs field like:

elt = $('.example_objects_as_tags > > input');
elt.tagsinput({
  itemValue: 'value',
  itemText: 'text',
});

and now try something like this

elt.tagsinput('add', { "value": 1 , "text": "Amsterdam" });