[AppDB] Show/hide div based on radio button clicks

Rosanne DiMesio dimesio at earthlink.net
Mon Nov 6 11:11:44 CST 2017


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 <dimesio at earthlink.net>
---
 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




More information about the wine-patches mailing list