# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: C:\Documents and Settings\175780\My Documents\NetBeansProjects\LimeSurvey\limesurvey
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: qanda.php
--- qanda.php Base (BASE)
+++ qanda.php Locally Modified (Based On LOCAL)
@@ -7420,19 +7420,7 @@
         $separatorwidth=(100-$answerwidth)/10;
         $columnswidth=100-$answerwidth-($separatorwidth*2);
 
-        $answer = "<script type='text/javascript'>\n"
-        . "<!--\n"
-        . "\tfunction special_checkconditions(value, name, type, rank)\n"
-        . "{\n"
-        . "\tif (value == '') {\n"
-        . "if (rank == 0) { dualname = name.replace(/#0/g,\"#1\"); }\n"
-        . "else if (rank == 1) { dualname = name.replace(/#1/g,\"#0\"); }\n"
-        . "document.getElementsByName(dualname)[0].value=value;\n"
-        . "\t}\n"
-        . "$checkconditionFunction(value, name, type);\n"
-        . "}\n"
-        . " //-->\n"
-        . " </script>\n";
+        $answer = "";
 
         // Get Answers
 
@@ -7578,7 +7566,7 @@
                     $answer .= "\t<td class=\"ddprefix\">$ddprefix</td>\n";
                 }
                 $answer .= "\t<td >\n"
-                . "<select name=\"$myfname\" id=\"answer$myfname\" onchange=\"special_checkconditions(this.value, this.name, this.type,$dualgroup);\">\n";
+                . "<select name=\"$myfname\" id=\"answer$myfname\" onchange=\"array_dual_dd_checkconditions(this.value, this.name, this.type,$dualgroup,$checkconditionFunction);\">\n";
 
                 if (!isset($_SESSION[$myfname]) || $_SESSION[$myfname] =='')
                 {
@@ -7632,7 +7620,7 @@
                 }
                 //				$answer .= "\t<td align='left' width='$columnswidth%'>\n"
                 $answer .= "\t<td>\n"
-                . "<select name=\"$myfname1\" id=\"answer$myfname1\" onchange=\"special_checkconditions(this.value, this.name, this.type,$dualgroup1);\">\n";
+                . "<select name=\"$myfname1\" id=\"answer$myfname1\" onchange=\"array_dual_dd_checkconditions(this.value, this.name, this.type,$dualgroup1,$checkconditionFunction);\">\n";
 
                 if (!isset($_SESSION[$myfname1]) || $_SESSION[$myfname1] =='')
                 {
Index: scripts/survey_runtime.js
--- scripts/survey_runtime.js Base (BASE)
+++ scripts/survey_runtime.js Locally Modified (Based On LOCAL)
@@ -875,3 +875,16 @@
 		_collection.push(new multi_total(ids[ii]));
 	}
 }
+
+//Special function for array dual scale in drop down layout to check conditions
+function array_dual_dd_checkconditions(value, name, type, rank, condfunction)
+{
+	if (value == '') {
+        //If value is set to empty, reset both drop downs and check conditions
+        if (rank == 0) { dualname = name.replace(/#0/g,"#1"); }
+        else if (rank == 1) { dualname = name.replace(/#1/g,"#0"); }
+        document.getElementsByName(dualname)[0].value=value;
+        condfunction(value, dualname, type);
+	}
+    condfunction(value, name, type);
+}
