{{! @template core/url_select Example context (json): { "id": "url_select_test", "action": "https://example.com/post", "formid": "url_select_form", "sesskey": "sesskey", "label": "core/url_select", "helpicon": { "title": "Help with something", "text": "Help with something", "url": "http://example.org/help", "linktext": "", "icon":{ "extraclasses": "iconhelp", "attributes": [ {"name": "src", "value": "../../../pix/help.svg"}, {"name": "alt", "value": "Help icon"} ] } }, "showbutton": "Go", "options": [{ "name": "Group 1", "isgroup": true, "options": [ {"name": "Item 1", "isgroup": false, "value": "1"}, {"name": "Item 2", "isgroup": false, "value": "2"} ]}, {"name": "Group 2", "isgroup": true, "options": [ {"name": "Item 3", "isgroup": false, "value": "3"}, {"name": "Item 4", "isgroup": false, "value": "4"} ]}], "disabled": false, "title": "Some cool title" } }}
{{#label}} {{/label}} {{#helpicon}} {{>core/help_icon}} {{/helpicon}} {{#showbutton}} {{/showbutton}} {{^showbutton}} {{/showbutton}}
{{^showbutton}} {{#js}} require(['jquery'], function($) { $('#{{id}}').change(function() { if (!$(this).val()) { return false; } $('#{{formid}}').submit(); }); }); {{/js}} {{/showbutton}}