diff options
author | Parker Berberian <pberberian@iol.unh.edu> | 2019-07-08 16:39:54 -0400 |
---|---|---|
committer | Parker Berberian <pberberian@iol.unh.edu> | 2019-07-10 09:12:20 -0400 |
commit | 38b4412f8b6cf21371b67e8de917f5a24b2bf72d (patch) | |
tree | b19adcaf27fce5d161b226017b62ce7e91a83be2 /src/templates | |
parent | 35c8640a32b7c6b3b35d68367668898fdfd7d423 (diff) |
Fixes and adds Tests
Fixes old tests and adds some more.
Also fixes linting errors
Change-Id: If84f0ed2dab5f9ffa7ce2deb92e058b0076d9154
Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
Diffstat (limited to 'src/templates')
-rw-r--r-- | src/templates/config_bundle/steps/define_software.html | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/templates/config_bundle/steps/define_software.html b/src/templates/config_bundle/steps/define_software.html index 7c47569..43f3f5d 100644 --- a/src/templates/config_bundle/steps/define_software.html +++ b/src/templates/config_bundle/steps/define_software.html @@ -27,20 +27,19 @@ {% block tablejs %} <script> - document.getElementById("radio_{{headnode}}").checked = true; + function radio_pre_submit(){ + var parents = document.getElementsByClassName("table_hidden_input_parent"); + for(const node of parents){ + const radio = node.getElementsByClassName("my_radio")[0]; + const checkbox = radio.nextElementSibling; + if(radio.checked){ + checkbox.value = "True"; + } + } + } + + form_submission_callbacks.push(radio_pre_submit); </script> {% endblock tablejs %} - - -{% block onleave %} -var parents = document.getElementsByClassName("table_hidden_input_parent"); -for(var i=0; i<parents.length; i++){ - var node = parents[i]; - var radio = node.getElementsByClassName("my_radio")[0]; - var checkbox = radio.nextElementSibling; - if(radio.checked){ - checkbox.value = "True"; - } -} |