forked from ietf-tools/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupload-session-agenda.js
More file actions
28 lines (25 loc) · 971 Bytes
/
Copy pathupload-session-agenda.js
File metadata and controls
28 lines (25 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$(document)
.ready(function () {
var form = $("form.my-3");
// review submission selection
form.find("[name=submission_method]")
.on("click change", function () {
var val = form.find("[name=submission_method]:checked")
.val();
var shouldBeVisible = {
upload: ['[name="file"]'],
enter: ['[name="content"]']
};
for (var v in shouldBeVisible) {
for (var i in shouldBeVisible[v]) {
var selector = shouldBeVisible[v][i];
var row = form.find(selector).parent();
if ($.inArray(selector, shouldBeVisible[val]) != -1)
row.show();
else
row.hide();
}
}
})
.trigger("change");
});