Skip to content

Commit

Permalink
Modified javascript for add/copy/edit question to hide or show 'manda…
Browse files Browse the repository at this point in the history
…tory' field based on question type (no point making a short-text or long-text mandatory)

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@184 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Apr 3, 2003
1 parent 70575ee commit d2ef4fd
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions admin/html.php
Expand Up @@ -369,7 +369,7 @@
$newquestion .= "\t\t</td>\n";
$newquestion .= "\t</tr>\n";

$newquestion .= "\t<tr>\n";
$newquestion .= "\t<tr id='MandatorySelection' style='display: none'>\n";
$newquestion .= "\t\t<td align='right'>$setfont<b>Mandatory?</b></font></td>\n";
$newquestion .= "\t\t<td>$setfont\n";
$newquestion .= "\t\t\tYes <input type='radio' name='mandatory' value='Y' />&nbsp;&nbsp;\n";
Expand All @@ -390,6 +390,15 @@
$newquestion .= "\t\tdocument.getElementById('OtherSelection').style.display = 'none';\n";
$newquestion .= "\t\tdocument.addnewquestion.other[1].checked = true;\n";
$newquestion .= "\t\t}\n";
$newquestion .= "\tif (QuestionType == 'S' || QuestionType == 'T')\n";
$newquestion .= "\t\t{\n";
$newquestion .= "\t\tdocument.getElementById('MandatorySelection').style.display = 'none';\n";
$newquestion .= "\t\tdocument.editquestion.mandatory[1].checked=true;\n";
$newquestion .= "\t\t}\n";
$newquestion .= "\telse\n";
$newquestion .= "\t\t{\n";
$newquestion .= "\t\tdocument.getElementById('MandatorySelection').style.display = '';\n";
$newquestion .= "\t\t}\n";
$newquestion .= "\t}\n";
$newquestion .= "\tOtherSelection('{$eqrow['type']}');\n";
$newquestion .= "-->\n";
Expand Down Expand Up @@ -455,7 +464,7 @@
$editquestion .= "\t\t</td>\n";
$editquestion .= "\t</tr>\n";

$editquestion .= "\t<tr>\n";
$editquestion .= "\t<tr id='MandatorySelection' style='display: none'>\n";
$editquestion .= "\t\t<td align='right'>$setfont<b>Mandatory?</b></font></td>\n";
$editquestion .= "\t\t<td>$setfont\n";
$editquestion .= "\t\t\tYes <input type='radio' name='mandatory' value='Y'";
Expand All @@ -480,6 +489,15 @@
$editquestion .= "\t\tdocument.getElementById('OtherSelection').style.display = 'none';\n";
$editquestion .= "\t\tdocument.editquestion.other[1].checked = true;\n";
$editquestion .= "\t\t}\n";
$editquestion .= "\tif (QuestionType == 'S' || QuestionType == 'T')\n";
$editquestion .= "\t\t{\n";
$editquestion .= "\t\tdocument.getElementById('MandatorySelection').style.display = 'none';\n";
$editquestion .= "\t\tdocument.editquestion.mandatory[1].checked=true;\n";
$editquestion .= "\t\t}\n";
$editquestion .= "\telse\n";
$editquestion .= "\t\t{\n";
$editquestion .= "\t\tdocument.getElementById('MandatorySelection').style.display = '';\n";
$editquestion .= "\t\t}\n";
$editquestion .= "\t}\n";
$editquestion .= "\tOtherSelection('{$eqrow['type']}');\n";
$editquestion .= "-->\n";
Expand Down Expand Up @@ -605,7 +623,7 @@
$editquestion .= "\t\t</td>\n";
$editquestion .= "\t</tr>\n";

$editquestion .= "\t<tr>\n";
$editquestion .= "\t<tr id='MandatorySelection' style='display: none'>\n";
$editquestion .= "\t\t<td align='right'>$setfont<b>Mandatory?</b></font></td>\n";
$editquestion .= "\t\t<td>$setfont\n";
$editquestion .= "\t\t\tYes <input type='radio' name='mandatory' value='Y'";
Expand All @@ -630,6 +648,15 @@
$editquestion .= "\t\tdocument.getElementById('OtherSelection').style.display = 'none';\n";
$editquestion .= "\t\tdocument.editquestion.other[1].checked = true;\n";
$editquestion .= "\t\t}\n";
$editquestion .= "\tif (QuestionType == 'S' || QuestionType == 'T')\n";
$editquestion .= "\t\t{\n";
$editquestion .= "\t\tdocument.getElementById('MandatorySelection').style.display = 'none';\n";
$editquestion .= "\t\tdocument.editquestion.mandatory[1].checked=true;\n";
$editquestion .= "\t\t}\n";
$editquestion .= "\telse\n";
$editquestion .= "\t\t{\n";
$editquestion .= "\t\tdocument.getElementById('MandatorySelection').style.display = '';\n";
$editquestion .= "\t\t}\n";
$editquestion .= "\t}\n";
$editquestion .= "\tOtherSelection('{$eqrow['type']}');\n";
$editquestion .= "-->\n";
Expand Down

0 comments on commit d2ef4fd

Please sign in to comment.