In this tutorial, I will let you know how to use bootstrap tagmanager jquery plugin with example.
Using tags, you can organize content on your website and you can have multiple instances of bootstrap tagmanager on a single page.
There are several plugin available with bootstrap with nice layouts like bootstrap form validation, bootstrap lightbox, bootstrap colorpicker, bootstrap datepicker etc.
You can use the bootstrap alert class to create colored tag boxes like tm-input-info
, tm-input-warning
, tm-input-danger
.
For this example, you will need following library :
- bootstrap.min.css
- bootstrap.min.js
- jquery.min.js
- tagmanager.min.css
- tagmanager.min.js
After this example, you can click the button "Show Demo" to see how bootstrap tagmanager is working with input elements.
- <!DOCTYPE html>
- <html>
- <head>
- <title>How to use Bootstrap Tags input jQuery plugin with example</title>
- <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
- <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/tagmanager/3.0.2/tagmanager.min.css">
- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
- <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/tagmanager/3.0.2/tagmanager.min.js"></script>
- </head>
- <body>
- <form>
- <div class="row">
- <div class="col-xs-12 col-sm-12 col-md-12">
- <div class="form-group">
- <strong>Content:</strong>
- <textarea class="form-control"></textarea>
- </div>
- </div>
- <div class="col-xs-12 col-sm-12 col-md-12">
- <div class="form-group">
- <strong>Tag:</strong>
- <input type="text" name="tags" placeholder="Tags" class="form-control tm-input tm-input-info"/>
- </div>
- </div>
- <div class="col-xs-12 col-sm-12 col-md-12 text-center">
- <button type="submit" class="btn btn-primary">Submit</button>
- </div>
- </div>
- </form>
- <script type="text/javascript">
- $(".tm-input").tagsManager();
- </script>
- </body>
- </html>
PHP Bootstrap - dynamic autocomplete tag input using jquery plugin