2 @template core/url_select
4 Example context (json):
6 "id": "url_select_test",
7 "action": "https://example.com/post",
8 "formid": "url_select_form",
10 "label": "core/url_select",
12 "title": "Help with something",
13 "text": "Help with something",
14 "url": "http://example.org/help",
17 "extraclasses": "iconhelp",
19 {"name": "src", "value": "../../../pix/help.svg"},
20 {"name": "alt", "value": "Help icon"}
26 "name": "Group 1", "isgroup": true, "options":
28 {"name": "Item 1", "isgroup": false, "value": "1"},
29 {"name": "Item 2", "isgroup": false, "value": "2"}
31 {"name": "Group 2", "isgroup": true, "options":
33 {"name": "Item 3", "isgroup": false, "value": "3"},
34 {"name": "Item 4", "isgroup": false, "value": "4"}
38 <div class="{{classes}}">
39 <form method="post" action="{{action}}" class="form-inline" id="{{formid}}">
40 <input type="hidden" name="sesskey" value="{{sesskey}}">
42 <label for="{{id}}"{{#labelattributes}} {{name}}="{{value}}"{{/labelattributes}}>
49 <select {{#attributes}}{{name}}="{{value}}" {{/attributes}} id="{{id}}" class="custom-select {{classes}}" name="jump">
52 <optgroup label="{{name}}">
54 <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
59 <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
64 <input type="submit" class="btn btn-secondary" value="{{showbutton}}">
68 <input type="submit" class="btn btn-secondary" value="{{#str}}go, core{{/str}}">
75 require(['jquery'], function($) {
76 $('#{{id}}').change(function() {
77 $('#{{formid}}').submit();