forked from ietf-tools/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsession_form.js
More file actions
28 lines (25 loc) · 795 Bytes
/
session_form.js
File metadata and controls
28 lines (25 loc) · 795 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
/* Copyright The IETF Trust 2021, All Rights Reserved
*
* JS support for the SessionForm
* */
(function() {
'use strict';
function track_common_input(input, name_suffix) {
const handler = function() {
const hidden_inputs = document.querySelectorAll(
'.session-details-form input[name$="-' + name_suffix + '"]'
);
for (let hi of hidden_inputs) {
hi.value = input.value;
}
};
input.addEventListener('change', handler);
handler();
}
function initialize() {
// Keep all the hidden inputs in sync with the main form
track_common_input(document.getElementById('id_attendees'), 'attendees');
track_common_input(document.getElementById('id_comments'), 'comments');
}
window.addEventListener('load', initialize);
})();