{"id":18870389,"url":"https://github.com/sebastiansulinski/ssd-select","last_synced_at":"2026-02-14T18:30:15.306Z","repository":{"id":57368837,"uuid":"48222148","full_name":"sebastiansulinski/ssd-select","owner":"sebastiansulinski","description":"jQuery plugin to handle most common events associated with the form 'select' tag.","archived":false,"fork":false,"pushed_at":"2018-01-22T14:25:18.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T12:36:54.397Z","etag":null,"topics":["ajax-call","jquery-form","jquery-plugin","ssd-select"],"latest_commit_sha":null,"homepage":null,"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/sebastiansulinski.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":"2015-12-18T07:57:02.000Z","updated_at":"2018-09-20T10:23:28.000Z","dependencies_parsed_at":"2022-09-05T19:20:36.139Z","dependency_job_id":null,"html_url":"https://github.com/sebastiansulinski/ssd-select","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastiansulinski%2Fssd-select","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastiansulinski%2Fssd-select/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastiansulinski%2Fssd-select/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastiansulinski%2Fssd-select/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebastiansulinski","download_url":"https://codeload.github.com/sebastiansulinski/ssd-select/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239816512,"owners_count":19701755,"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","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-call","jquery-form","jquery-plugin","ssd-select"],"created_at":"2024-11-08T05:20:02.147Z","updated_at":"2026-02-14T18:30:15.211Z","avatar_url":"https://github.com/sebastiansulinski.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SSD Select\njQuery plugin to handle most common events associated with the form 'select' tag.\n\n[See demo](http://ssd-select.ssdtutorials.com/)\n\n## Installation\n\nYou can install this plugin via `npm`:\n\n```\nnpm install ssd-select\n```\n\n## Usage instructions\n\nFirst include all resources and call the plugin\n\n```\n\u003cscript src=\"./node_modules/jquery/dist/jquery.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"./node_modules/ssd-select/src/jquery.ssd-select.min.js\"\u003e\u003c/script\u003e\n```\n\n### Instantiating the plugin\n\nTo instantiate the plugin you have two options.\nYou strictly specify what action you want to bind to a given element\n\n```\n\u003cscript\u003e\n    $('[data-ssd-select]').ssdSelect({\n        action : 'call-redirect'\n    });\n\u003c/script\u003e\n```\n\nor you can tell it to dynamically obtain it from a specific attribute of that element (default is `data-ssd-select`)\n\n```\n\u003cscript\u003e\n    $('[data-ssd-select]').ssdSelect({\n        action_attribute : 'data-ssd-select'\n    });\n\u003c/script\u003e\n```\n\nAdditionally, you need to provide the name of the css class that will hide elements from the view (default is `dn`)\n\n```\n\u003cscript\u003e\n    $('[data-ssd-select]').ssdSelect({\n        hide_class : 'dn'\n    });\n\u003c/script\u003e\n```\n\nIf the value is store in a different attribute then the default `value`, you can use the `value_attribute` property.\n\n```\n\u003cscript\u003e\n    $('[data-ssd-select]').ssdSelect({\n        value_attribute : 'data-value'\n    });\n\u003c/script\u003e\n```\n\n- The `action` allows you to specify a single action to be used on the select object.\n- The `action_attribute` represents the attribute that will store the type of the action required for a given select object.\n- The `hide_class` is used to specify the class name that has `display` set to `none` as it will be used to show and hide certain elements.\n- The `value_attribute` allows you to specify which attribute of the `option` tag should be used instead of a default `value`\n\n```\n.dn {\n    display: none;\n}\n```\n\n### Available actions\n\nYou're now ready to apply it to your `select` elements\n\n#### Make ajax call and redirect `call-redirect`\n\n```\n\u003cselect data-ssd-select=\"call-redirect\"\u003e\n    \u003coption value=\"/\"\u003eSelect one\u003c/option\u003e\n    \u003coption value=\"./calls/redirect.json\"\u003eFirst\u003c/option\u003e\n    \u003coption value=\"./calls/redirect.json\"\u003eSecond\u003c/option\u003e\n\u003c/select\u003e\n```\n\nAjax call should return the response in the following format:\n\n```\n{\n  \"redirect\": \"http://ssdtutorials.com\"\n}\n```\n\n#### Make ajax call and reload the page `call-reload`\n\n```\n\u003cselect data-ssd-select=\"call-reload\"\u003e\n    \u003coption value=\"/\"\u003eSelect one\u003c/option\u003e\n    \u003coption value=\"./calls/reload.json\"\u003eFirst\u003c/option\u003e\n    \u003coption value=\"./calls/reload.json\"\u003eSecond\u003c/option\u003e\n\u003c/select\u003e\n```\n\nNo response needed for this call.\n\n#### Make ajax call and replace content `call-replace`\n\n```\n\u003cselect data-ssd-select=\"call-replace\"\u003e\n    \u003coption value=\"/\"\u003eSelect one\u003c/option\u003e\n    \u003coption value=\"./calls/replace.json\"\u003eReplace\u003c/option\u003e\n\u003c/select\u003e\n\n\u003cdiv class=\"first-replacement\"\u003eFirst\u003c/div\u003e\n\u003cdiv class=\"second-replacement\"\u003eSecond\u003c/div\u003e\n```\n\nAjax call should return the response in the following format:\n\n```\n{\n  \"replace\": {\n    \".first-replacement\": \"First replacement\",\n    \".second-replacement\": \"Second replacement\"\n  }\n}\n```\n\n#### Make ajax call and replace elements `call-replace-with`\n\n\u003cselect data-ssd-select=\"call-replace-with\"\u003e\n    \u003coption value=\"/\"\u003eSelect one\u003c/option\u003e\n    \u003coption value=\"./calls/replace-with.json\"\u003eReplace\u003c/option\u003e\n\u003c/select\u003e\n\n\u003cdiv class=\"first-replacement-with\"\u003eFirst\u003c/div\u003e\n\u003cdiv class=\"second-replacement-with\"\u003eSecond\u003c/div\u003e\n\nAjax call should return the response in the following format:\n\n```\n{\n  \"replace\": {\n    \".first-replacement-with\": \"\u003cp\u003eFirst replacement with\u003c/p\u003e\",\n    \".second-replacement-with\": \"\u003cp\u003eSecond replacement with\u003c/p\u003e\"\n  }\n}\n```\n\n#### Make ajax call and perform action returned with the response `call-action`\n\n```\n\u003cselect data-ssd-select=\"call-action\"\u003e\n    \u003coption value=\"/\"\u003eSelect one\u003c/option\u003e\n    \u003coption value=\"./calls/action-redirect.json\"\u003eRedirect\u003c/option\u003e\n    \u003coption value=\"./calls/action-reload.json\"\u003eReload\u003c/option\u003e\n    \u003coption value=\"./calls/action-replace.json\"\u003eReplace\u003c/option\u003e\n    \u003coption value=\"./calls/action-replace-with.json\"\u003eReplace with\u003c/option\u003e\n\u003c/select\u003e\n\n\u003cdiv class=\"action-first-replacement\"\u003eFirst\u003c/div\u003e\n\u003cdiv class=\"action-second-replacement\"\u003eSecond\u003c/div\u003e\n\n\u003cdiv class=\"action-third-replacement-with\"\u003eThird\u003c/div\u003e\n\u003cdiv class=\"action-fourth-replacement-with\"\u003eFourth\u003c/div\u003e\n```\n\nAjax call should return the response as it would for any of the relevant actions plus the index `action` to indicate the desired action i.e.\n\n```\n{\n  \"action\": \"redirect\",\n  \"redirect\": \"http://ssdtutorials.com\"\n}\n```\n\n\n#### Navigate to `go-to`\n\n```\n\u003cselect data-ssd-select=\"go-to\"\u003e\n    \u003coption value=\"/\"\u003eSelect one\u003c/option\u003e\n    \u003coption value=\"./calls/go-to-1.html\"\u003eFirst\u003c/option\u003e\n    \u003coption value=\"./calls/go-to-2.html\"\u003eSecond\u003c/option\u003e\n\u003c/select\u003e\n```\n\n#### Show selected and hide others `show-hide`\n\n```\n\u003cselect data-ssd-select=\"show-hide\"\u003e\n    \u003coption value=\"/\"\u003eSelect one\u003c/option\u003e\n    \u003coption value=\"#\" data-target=\".first\"\u003eFirst\u003c/option\u003e\n    \u003coption value=\"#\" data-target=\".second\"\u003eSecond\u003c/option\u003e\n    \u003coption value=\"#\" data-target=\".third\"\u003eThird\u003c/option\u003e\n\u003c/select\u003e\n\n\u003cdiv class=\"first\"\u003eFirst\u003c/div\u003e\n\u003cdiv class=\"second dn\"\u003eSecond\u003c/div\u003e\n\u003cdiv class=\"third dn\"\u003eThird\u003c/div\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastiansulinski%2Fssd-select","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebastiansulinski%2Fssd-select","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastiansulinski%2Fssd-select/lists"}