Through row 140

This commit is contained in:
2018-11-24 21:09:35 +00:00
parent 2fb4f8771c
commit d87604c6bd
3 changed files with 126 additions and 56 deletions

View File

@ -103,6 +103,10 @@
checkbox: "#id_negative_case_reasons_8",
showHide: "#div_id_negative_case_reasons_other"
},
{
checkbox: "[name=use_in_energy_economy][value=OTR]",
showHide: "#div_id_use_in_energy_economy_other"
}
];
var conditionalRadioGroups = [
@ -135,24 +139,16 @@
{
name: "sector_of_economy",
redraw: function() {
var sections = [
{
"input": "id_id_sector_of_economy_0_1",
"section": "power_generation_questions",
},
{
"input": "id_id_sector_of_economy_0_2",
"section": "power_grids_energy_storage_questions",
},
{
"input": "id_id_sector_of_economy_0_3",
"section": "mineral_commodity_questions",
},
]
const sections = {
RN: "power_generation_questions",
PG: "power_grids_energy_storage_questions",
SM: "mineral_commodity_questions",
MA: "manufacturing_questions",
}
for (const option of sections) {
const input = document.getElementById(option.input)
const section = document.getElementById(option.section)
for (const option of Object.keys(sections)) {
const input = document.querySelector(`[name=sector_of_economy][value=${option}]`)
const section = document.getElementById(sections[option])
showIf(section, input.checked)
}