Rosanne DiMesio : Show/ hide What doesnt work and Workarounds textareas based on user input

Jeremy Newman jnewman at winehq.org
Tue Nov 7 10:05:11 CST 2017


Module: appdb
Branch: master
Commit: 88f3a7acddf72c1660af7b873ed5b219ea0711ae
URL:    http://source.winehq.org/git/appdb.git/?a=commit;h=88f3a7acddf72c1660af7b873ed5b219ea0711ae

Author: Rosanne DiMesio <dimesio at earthlink.net>
Date:   Mon Nov  6 11:13:13 2017 -0600

Show/hide What doesnt work and Workarounds textareas based on user input

Hides these textareas by default and only shows them if the
user responds "Yes" to the accompanying yes/no question.

Signed-off-by: Rosanne DiMesio <dimesio at earthlink.net>
Signed-off-by: Jeremy Newman <jnewman at codeweavers.com>

---

 include/testData.php | 35 +++++++++++++++++++++--------------
 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/include/testData.php b/include/testData.php
index ad4dea9..1083cfb 100644
--- a/include/testData.php
+++ b/include/testData.php
@@ -858,44 +858,51 @@ class testData{
         // What Does not work
         echo '<tr valign=top><td><b>What does not work</b></td>',"\n";
         echo '<td>';
-        echo 'Were there any problems that do not exist in Windows? <i>If yes, describe the problems in the box below.</i><br>';
+        echo 'Were there any problems that do not exist in Windows? <br>';
         if(isset($this->sHasProblems))        
         {
             if($this->sHasProblems == "Yes")
             {
-                echo '<label class="radio-inline"><input type="radio" name="sHasProblems" value="Yes" checked>Yes</label>';
-                echo '<label class="radio-inline"><input type="radio" name="sHasProblems" value="No">No</label>';
+                echo '<label class="radio-inline"><input type="radio" data-toggle="radioshow" data-target="#whatdoesnt" data-showdiv=true name="sHasProblems" value="Yes" checked>Yes</label>';
+                echo '<label class="radio-inline"><input type="radio" data-toggle="radioshow" data-target="#whatdoesnt" data-showdiv=false name="sHasProblems" value="No">No</label>';
             }else{
-                echo '<label class="radio-inline"><input type="radio" name="sHasProblems" value="Yes">Yes</label>';
-                echo '<label class="radio-inline"><input type="radio" name="sHasProblems" value="No" checked>No</label>';
+                echo '<label class="radio-inline"><input type="radio"data-toggle="radioshow" data-target="#whatdoesnt" data-showdiv=true name="sHasProblems" value="Yes">Yes</label>';
+                echo '<label class="radio-inline"><input type="radio" data-toggle="radioshow" data-target="#whatdoesnt" data-showdiv=false name="sHasProblems" value="No" checked>No</label>';
             } 
         } else {
-             echo '<label class="radio-inline"><input type="radio" name="sHasProblems" value="Yes">Yes</label>';
-             echo '<label class="radio-inline"><input type="radio" name="sHasProblems" value="No">No</label><br>';
+             echo '<label class="radio-inline"><input type="radio" data-toggle="radioshow" data-target="#whatdoesnt" data-showdiv=true name="sHasProblems" value="Yes">Yes</label>';
+             echo '<label class="radio-inline"><input type="radio" data-toggle="radioshow" data-target="#whatdoesnt" data-showdiv=false name="sHasProblems" value="No">No</label>';
         };
+        echo '<div id="whatdoesnt" style="display:none">';
+        echo '<i>Describe the problem(s) in the box below.</i><br>';
         echo '<p><textarea cols="80" rows="20" id="Test2" name="shWhatDoesnt" class="wysiwyg">';
         echo $this->shWhatDoesnt.'</textarea></p></td></tr>',"\n";
+        echo '</div>';
         
         // Workarounds
         echo '<tr valign=top><td><b>Workarounds</b></td>',"\n";
         echo '<td>';
-        echo 'Were any workarounds used for problems that do not exist in Windows? <i>If yes, describe the workaround(s) in the box below.</i><br>';
+        echo 'Were any workarounds used for problems that do not exist in Windows? <br>';
         if(isset($this->sUsedWorkaround))        
         {
             if($this->sUsedWorkaround == "Yes")
             {
-                echo '<label class="radio-inline"><input type="radio" name="sUsedWorkaround" value="Yes" checked>Yes</label>';
-                echo '<label class="radio-inline"><input type="radio" name="sUsedWorkaround" value="No">No</label>';
+                echo '<label class="radio-inline"><input type="radio" data-toggle="radioshow" data-target="#workarounds" data-showdiv=true  name="sUsedWorkaround" value="Yes" checked>Yes</label>';
+                echo '<label class="radio-inline"><input type="radio" data-toggle="radioshow" data-target="#workarounds" data-showdiv=false name="sUsedWorkaround" value="No">No</label>';
             }else{
-                echo '<label class="radio-inline"><input type="radio" name="sUsedWorkaround" value="Yes">Yes</label>';
-                echo '<label class="radio-inline"><input type="radio" name="sUsedWorkaround" value="No" checked>No</label>';
+                echo '<label class="radio-inline"><input type="radio" data-toggle="radioshow" data-target="#workarounds" data-showdiv=true  name="sUsedWorkaround" value="Yes">Yes</label>';
+                echo '<label class="radio-inline"><input type="radio" data-toggle="radioshow" data-target="#workarounds" data-showdiv=false  name="sUsedWorkaround" value="No" checked>No</label>';
             } 
         } else {
-             echo '<label class="radio-inline"><input type="radio" name="sUsedWorkaround" value="Yes">Yes</label>';
-             echo '<label class="radio-inline"><input type="radio" name="sUsedWorkaround" value="No">No</label><br>';
+             echo '<label class="radio-inline"><input type="radio" data-toggle="radioshow" data-target="#workarounds" data-showdiv=true name="sUsedWorkaround" value="Yes">Yes</label>';
+             echo '<label class="radio-inline"><input type="radio" data-toggle="radioshow" data-target="#workarounds" data-showdiv=false name="sUsedWorkaround" value="No">No</label><br>';
         };
+        
+        echo '<div id="workarounds" style="display:none">';
+        echo '<i>Describe the workaround(s) in the box below.</i><br>';
         echo '<textarea cols="80" rows="20" id="Test4" name="shWorkarounds" class="wysiwyg">';
         echo $this->shWorkarounds.'</textarea></p></td></tr>',"\n";
+        echo '</div>';
         
         // What was not tested
         echo '<tr valign=top><td><b>What was not tested</b></td>',"\n";




More information about the wine-cvs mailing list