I’m going to use bootstrap tagsinput without adding new tags feature (only remove tags). How to disable adding new tags?
I’m using latest bootstrap tagsinput v0.8.0 with twitter bootstrap 3.
Here is my snippet:
<input id="removeonlyinput" type="text" value="Amsterdam,Berlin,Lisbon" data-role="tagsinput" />
<script>
$('#removeonlyinput').tagsinput({
freeinput: false
});
</script>
5
Answers
You can modify
bootstrap-tagsinput.js
file.find
maxTags:,
line and make itmaxTags: 0,
Then it won’t add new tags.
In this way I achieved the functionality.
Hope this helps!
Try to use
beforeItemAdd
event:How about making the input field readonly ? By this no user can type in the input text.
you can do this
don’t mind the extra spaces.
it’s not
it’s