{"id":31882742,"url":"https://github.com/amsify42/jquery.amsify.suggestags","last_synced_at":"2025-10-13T02:57:51.032Z","repository":{"id":47452691,"uuid":"130998189","full_name":"amsify42/jquery.amsify.suggestags","owner":"amsify42","description":"This is a JQuery plugin for input tags with auto complete suggestion.","archived":false,"fork":false,"pushed_at":"2024-06-27T17:52:54.000Z","size":105,"stargazers_count":62,"open_issues_count":7,"forks_count":39,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-08-09T16:51:02.246Z","etag":null,"topics":["ajax","jquery-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amsify42.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-25T11:45:51.000Z","updated_at":"2024-11-26T13:42:12.000Z","dependencies_parsed_at":"2022-09-26T18:20:46.787Z","dependency_job_id":null,"html_url":"https://github.com/amsify42/jquery.amsify.suggestags","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/amsify42/jquery.amsify.suggestags","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amsify42%2Fjquery.amsify.suggestags","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amsify42%2Fjquery.amsify.suggestags/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amsify42%2Fjquery.amsify.suggestags/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amsify42%2Fjquery.amsify.suggestags/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amsify42","download_url":"https://codeload.github.com/amsify42/jquery.amsify.suggestags/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amsify42%2Fjquery.amsify.suggestags/sbom","scorecard":{"id":190683,"data":{"date":"2025-08-11","repo":{"name":"github.com/amsify42/jquery.amsify.suggestags","commit":"a4cc7c1c55c5628e9fb3cfc1bbc35cfef6dfc74e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":2,"reason":"Found 5/22 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 13 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T20:36:50.804Z","repository_id":47452691,"created_at":"2025-08-16T20:36:50.804Z","updated_at":"2025-08-16T20:36:50.804Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014028,"owners_count":26085348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ajax","jquery-plugin"],"created_at":"2025-10-13T02:57:33.438Z","updated_at":"2025-10-13T02:57:51.027Z","avatar_url":"https://github.com/amsify42.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Jquery Suggestags\n-----------------\nThis is a JQuery plugin for input tags with auto complete suggestion.\n\n```js\n$('input').amsifySuggestags();\n```\n\n## npm installation\n```cmd\nnpm i suggestags\n```\n\n\n# Table of Contents\n1. [Simple](#simple-tags)\n2. [Default Value](#default-value)\n3. [Suggestions](#suggestions)\n4. [Suggestions Through Ajax](#suggestions-through-ajax)\n5. [White List](#white-list)\n6. [Custom Stylings](#custom-stylings)\n7. [Callbacks and Events](#callbacks-and-events)\n8. [Tag Limit](#tag-limit)\n9. [Refresh Destroy](#refresh-destroy)\n10. [More Settings](#more-settings)\n11. [Instantiating](#instantiating)\n\n## Simple Tags\nFor simple initialization\n```html\n\u003cinput type=\"text\" class=\"form-control\" name=\"country\"/\u003e\n```\n```js\n$('input[name=\"country\"]').amsifySuggestags();\n```\n## Default Value\nIf input is already having value separated by comma, it will load the tags by default\n```html\n\u003cinput type=\"text\" class=\"form-control\" name=\"country\" value=\"India,UAE,Nepal\"/\u003e\n```\n```js\n$('input[name=\"country\"]').amsifySuggestags();\n```\n\n## Suggestions\nList of values can be passed to get the suggestions.\n```html\n\u003cinput type=\"text\" class=\"form-control\" name=\"country\"/\u003e\n```\n```js\n$('input[name=\"country\"]').amsifySuggestags({\n\tsuggestions: ['India', 'Pakistan', 'Nepal', 'UAE', 'Iran', 'Bangladesh']\n});\n```\nList if objects can also be set to have tag/value pair.\n```html\n\u003cinput type=\"text\" class=\"form-control\" name=\"color\"/\u003e\n```\n```js\n$('input[name=\"color\"]').amsifySuggestags({\n\tsuggestions: [\n\t\t\t\t\t{tag: 'Black', value: 1},\n\t\t\t\t\t{tag: 'White', value: 2},\n\t\t\t\t\t{tag: 'Red', value: 3},\n\t\t\t\t\t{tag: 'Blue', value: 4},\n\t\t\t\t\t{tag: 'Green', value: 5},\n\t\t\t\t\t{tag: 'Orange', value: 6}\n\t\t\t\t]\n});\n```\nInput will store `value` separated by comma like this\n```html\n\u003cinput type=\"text\" class=\"form-control\" name=\"1,2,3,4,5,6\"/\u003e\n```\n**Note:** While setting the default value for the input, set actual value separated by comma not tag names.\n\n## Suggestions Through Ajax\nWe can also get suggestions through Ajax\n```html\n\u003cinput type=\"text\" class=\"form-control\" name=\"country\"/\u003e\n```\n```js\n$('input[name=\"country\"]').amsifySuggestags({\n\tsuggestionsAction : {\n\t\turl: 'http://www.site.com/suggestions'\n\t}\n});\n```\n\nAjax method type will be **GET**, structure of request data you will receive is\n```json\n{\n\t\"existing\": [\"one\", \"two\", \"three\"],\n\t\"term\": \"something\"\n}\n```\n**existing** is an array of already loaded tags and **term** is the string you are trying to search.\n\u003cbr/\u003e\nThe success response should at least contain **suggestions** key and its value should be of type list/array:\n```json\n{\n\t\"suggestions\": [\"four\", \"five\", \"six\"]\n}\n```\n\u003cbr/\u003e\u003cbr/\u003e\nYou can also add these settings and callbacks to this option\n```js\n$('input[name=\"country\"]').amsifySuggestags({\n\tsuggestionsAction : {\n\t\ttimeout: -1,\n\t\tminChars: 2,\n\t\tminChange: -1,\n\t\tdelay: 100,\n\t\ttype: 'GET',\n\t\turl: 'http://www.site.com/suggestions',\n\t\tdataType: null,\n\t\tbeforeSend : function() {\n\t\t\tconsole.info('beforeSend');\n\t\t},\n\t\tsuccess: function(data) {\n\t\t\tconsole.info('success');\n\t\t},\n\t\terror: function() {\n\t\t\tconsole.info('error');\n\t\t},\n\t\tcomplete: function(data) {\n\t\t\tconsole.info('complete');\n\t\t}\n\t}\n});\n```\n```\ntimeout - It is for cancelling the request after given specific seconds, default is -1\nminChars - It is the minimum chars types before the first ajax hit, default is 2\nminChange - It recall the ajax based on the minimum percentage chars changed compared to the string passed in last ajax call, default is -1\ndelay - It is the milliseconds time delay to call ajax or whitelist suggestions on text entered and wait, defult is 100\ntype - It is type of method we pass, default is GET\ndataType - It is dateType of request data being passed, default is null\n```\n**Note**: **success** and **complete** callbacks does not directly override the original ajax callbacks, rather it gets called after original ones are executed.\n\n\n## White List\nThis option simply does not allow any other inputs other than from suggestions.\n```html\n\u003cinput type=\"text\" class=\"form-control\" name=\"country\"/\u003e\n```\n```js\n$('input[name=\"country\"]').amsifySuggestags({\n\tsuggestions: ['India', 'Pakistan', 'Nepal', 'UAE', 'Iran', 'Bangladesh'],\n\twhiteList: true\n});\n```\n\n## Custom Stylings\n```html\n\u003cinput type=\"text\" class=\"form-control\" name=\"country\"/\u003e\n```\nFor setting default class for tags, you can pass this setting\n```js\n$('input[name=\"country\"]').amsifySuggestags({\n\tsuggestions: ['India', 'Pakistan', 'Nepal', 'UAE', 'Iran', 'Bangladesh'],\n\twhiteList: true,\n\tdefaultTagClass: 'badge'\n});\n````\nWe can pass list of classes, colors or backgrounds through settings\n```js\n$('input[name=\"country\"]').amsifySuggestags({\n\tsuggestions: ['India', 'Pakistan', 'Nepal', 'UAE', 'Iran', 'Bangladesh'],\n\twhiteList: true,\n\tclasses: ['bg-primary', 'bg-success', 'bg-danger', 'bg-warning', 'bg-info']\n});\n```\nEach class will apply to each suggestion tag through their corresponding keys. We can also pass backgrounds and colors.\n```js\n$('input[name=\"country\"]').amsifySuggestags({\n\tsuggestions: ['India', 'Pakistan', 'Nepal', 'UAE', 'Iran', 'Bangladesh'],\n\twhiteList: true,\n\tbackgrounds: ['blue', 'green', 'red', 'orange', '#424242'],\n\tcolors: ['white', 'black', 'white', 'black', 'white'],\n});\n```\nWe can also set class, color and background at each suggestion item if the suggestion items are object.\n\n```js\n$('input[name=\"color\"]').amsifySuggestags({\n\tsuggestions: [\n\t\t\t\t\t{tag: 'Black', value: 1, background:'black', color:'white'},\n\t\t\t\t\t{tag: 'White', value: 2, background:'white', color:'black'},\n\t\t\t\t\t{tag: 'Red', value: 3, background:'red', color:'white'},\n\t\t\t\t\t{tag: 'Blue', value: 4, background:'blue', color:'white'},\n\t\t\t\t\t{tag: 'Green', value: 5, background:'green', color:'white'},\n\t\t\t\t\t{tag: 'Orange', value: 6, background:'orange', color:'white'}\n\t\t\t\t]\n});\n```\nSame suggestions can also be passed in ajax response to get these stylings working\n```json\n{\n\t\"suggestions\": [\n\t\t{\n\t\t\t\"tag\": \"Black\",\n\t\t\t\"value\": 1,\n\t\t\t\"background\":\"black\",\n\t\t\t\"color\":\"white\"\n\t\t},\n\t\t{\n\t\t\t\"tag\": \"White\",\n\t\t\t\"value\": 2,\n\t\t\t\"background\":\"white\",\n\t\t\t\"color\":\"black\"\n\t\t}\n\t]\n}\n\n```\n\n## Callbacks and Events\nWe can set callbacks on add/remove tag elements\n```js\n$('input[name=\"country\"]').amsifySuggestags({\n\tafterAdd : function(value) {\n\t\tconsole.info(value); // Parameter will be value\n\t},\n\tafterRemove : function(value) {\n\t\tconsole.info(value); // Parameter will be value\n\t},\n});\n```\n\nor we can also subscribe to add/remove events\n```js\n$('input[name=\"country\"]').on('suggestags.add', function(e){\n\t// Do something after adding tag\n});\n$('input[name=\"country\"]').on('suggestags.change', function(e){\n\t// Do something while add/remove tag\n});\n$('input[name=\"country\"]').on('suggestags.remove', function(e){\n\t// Do something before removing tag\n});\n```\n\n## Tag Limit\nWe can also set tags limit\n```js\n$('input[name=\"country\"]').amsifySuggestags({\n\ttagLimit: 5\n});\n```\n\n## Refresh Destroy\nFor refreshing the values, you can use\n```js\nvar params = {\n\t// Make sure you have parameters which used during first execution\n};\n$('input[name=\"country\"]').amsifySuggestags(params, 'refresh');\n```\nFor destroying the instance, you can do\n```js\n$('input[name=\"country\"]').amsifySuggestags({}, 'destroy');\n```\n\n## More Settings\n### selectOnHover\n```js\n$('input[name=\"country\"]').amsifySuggestags({\n\tselectOnHover: false\n});\n```\nIt will not select the suggested tag value when the mouse hover the suggestion item. By default the value is `true`\n### noSuggestionMsg\nThis will show message when there is no suggested item appears matching the input.\n```js\n$('input[name=\"country\"]').amsifySuggestags({\n\tnoSuggestionMsg: 'Enter to generate new tag'\n});\n```\n### showAllSuggestions\nThis will show all the suggestion item on input focus. By default this is `false`\n```js\n$('input[name=\"country\"]').amsifySuggestags({\n\tshowAllSuggestions: true\n});\n```\n### keepLastOnHoverTag\nThis will keep the last suggestion item in the input text field, even when moving away from the suggestion list. By default this is `true`.\nUseful when `showAllSuggestions` is set to `true` and you wish to hide the suggestion list when clicking away from the input text field.\n```js\n$('input[name=\"country\"]').amsifySuggestags({\n\tkeepLastOnHoverTag: false\n});\n```\n### printValues\nBy default, input value and its tag names gets printed in console. You can set it false not to print in console.\n```js\n$('input[name=\"country\"]').amsifySuggestags({\n\tprintValues: false\n});\n```\n### showPlusAfter\nThis setting is for hiding proceeding tags when focus is out of tags section and show the **+ number** instead. By default it is 0, you can set the number to hide the tags after the given number when focus is out.\n```js\n$('input[name=\"country\"]').amsifySuggestags({\n\tshowPlusAfter: 0\n});\n```\n### suggestMatch\nA callback function can be passed to match the user entered text with suggestion item to show in suggestions list for custom matching.\n```js\n$('input[name=\"country\"]').amsifySuggestags({\n\tsuggestions: ['India', 'Pakistan', 'Nepal', 'UAE', 'Iran', 'Bangladesh'],\n\tsuggestMatch : function(suggestionItem, value) {\n\t    return ~suggestionItem.toString().toLowerCase().indexOf(value.toString().toLowerCase());\n\t}\n});\n```\nThis callback will receive two parameters, suggestion item value and the text value entered by user. Both parameters can be used to do custom matching and return non zero value to let that suggestion appear in suggestions list.\n\n## Instantiating\nThis is also one of the approach you can use this plugin.\n### Initilization\nYou can initialize by creating an instance of `AmsifySuggestags` and passing selector to it.\n```js\namsifySuggestags = new AmsifySuggestags($('input[name=\"country\"]'));\namsifySuggestags._init();\n```\n### Settings\nYou need to set it before initialization and you can use all the setting options shown in previous approach.\n```js\namsifySuggestags._settings({\n\tsuggestions: ['Black', 'White', 'Red', 'Blue', 'Green', 'Orange']\n})\namsifySuggestags._init();\n````\n### Add/Remove Tag\nYou can call these methods to add/remove tag with instance of `AmsifySuggestags`\n```js\namsifySuggestags.addTag('Purple');\namsifySuggestags.removeTag('Red');\n\n```\n### Refresh Destroy\nYou can call these methods to refresh/destroy\n```js\namsifySuggestags.refresh();\namsifySuggestags.destroy();\n\n```\n**Note**: This approach only works for single selector element not for multiple elements having same selector.\n\u003cbr/\u003e\nFor making it work for selector having multiple elements, you can do something like this:\n```js\n$('.tags-input').each(function(){\n\tamsifySuggestags = new AmsifySuggestags($(this));\n\tamsifySuggestags._init();\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famsify42%2Fjquery.amsify.suggestags","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famsify42%2Fjquery.amsify.suggestags","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famsify42%2Fjquery.amsify.suggestags/lists"}