[AppDB] Show/hide div based on radio button clicks
Rosanne DiMesio <[email protected]> Mon, 6 Nov 2017 11:11:44 -0600
| Newsgroups | gmane.comp.emulators.wine.patches |
|---|---|
| Message-ID | <[email protected]> |
Adds javascript function that will be used to show or hide the test report form textareas that have radio button yes/no questions (currently the What does not work and Workarounds fields). Signed-off-by: Rosanne DiMesio <[email protected]> --- js/utils.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/js/utils.js b/js/utils.js index 0fdcb92..b4adc9a 100644 --- a/js/utils.js +++ b/js/utils.js @@ -222,9 +222,19 @@ $(document).ready(function() $(this).collapse('show'); } }); - - // HTML editor (redactor loader) + + /* Show/hide div based on radio button clicks. */ + $('input[type=radio][data-toggle=radioshow]').click(function(){ + if($(this).data("showdiv") == true) { + $($(this).data("target")).show(); + } + else if($(this).data("showdiv") == false) { + $($(this).data("target")).hide(); + } + }); + $('[data-toggle="radioshow"]:checked').trigger('click'); + // HTML editor (redactor loader) }); -- 2.12.3