Auto Suggest Dynamic Input Tag
Submitted by rinvizle on Wednesday, September 7, 2016 - 12:00.
In this tutorial we will show you a Auto Suggest Dynamic Input Tag in jQuery. Most of the social media's has a input tag's fields that are commonly used. This project has a autocomplete suggestions generated from the list of JSON queries and jQuery plugins. The system works with a predefined tags in the plugin to work. And for the tags to be work the database from the AJAX will pull and the results to display in the input tags form. This project is a great method for the developers to get in more to the inputs by using predefined tags.
And for the Database using the JSON script to response.
Hope that you learn from this tutorial and don't forget to Like & Share this project and the website. Enjoy Coding...!
Sample Code
Index.html - This script is for the html forms to display and insert the tags in the page.- <!DOCTYPE html>
- <html>
- <head>
- <link rel="stylesheet" type="text/css" media="all" href="css/styles.css">
- <link rel="stylesheet" type="text/css" media="all" href="css/styleinput.css">
- <link rel="stylesheet" type="text/css" media="all" href="css/styleinput1.css">
- </head>
- <body>
- <div id="wrapper" align="center">
- <div id="searchbar">
- <input type="text" id="vidyagames" name="vidya">
- </div>
- <div id="footer">
- </div>
- </div>
- </body>
- </html>
- <script type="text/javascript">
- $(function(){
- $('#vidyagames').tokenInput([
- {id: 7, name: "League of Legends"},
- {id: 11, name: "Dota"},
- {id: 13, name: "Dota2"},
- {id: 17, name: "League of Angels"},
- {id: 19, name: "Run Online"},
- {id: 23, name: "Cabal Online"},
- {id: 29, name: "RF Online"},
- {id: 32, name: "Special Force"},
- {id: 35, name: "Starcraft"},
- {id: 38, name: "God of Wars"},
- {id: 41, name: "Baby Run"},
- {id: 43, name: "Final Fantasy"},
- {id: 44, name: "Resident Evil"},
- {id: 46, name: "Kingdom Hearts"},
- {id: 54, name: "Civilization"},
- {id: 72, name: "Tomb Raider"},
- {id: 77, name: "Crossfire"}
- ], {
- hintText: "Know Of RPG's Games..?",
- noResultsText: "Nothing Found.",
- searchingText: "Gaming...",
- preventDuplicates: true
- });
- });
- </script>
Add new comment
- 47 views