Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed bug: Mandatory numerical question with entry of Zero (0) was no…
…t registering.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@281 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed May 13, 2003
1 parent 59afdbc commit 58402e5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.php
Expand Up @@ -62,7 +62,7 @@
session_destroy();
}

if ($fvalue)
if ($fvalue || $fvalue == "0")
{
if ($fvalue == " ")
{
Expand Down Expand Up @@ -108,7 +108,7 @@
}

//This section handles the question number that will be answered - moving backwards and forwards as required
if ($_POST['mandatory'] == "Y" && (!$_POST['fvalue'] || $_POST['fvalue'] == " ") && !$multimandatory) //if the last question was mandatory but there is no data
if ($_POST['mandatory'] == "Y" && ($_POST['fvalue'] != "0" && !$_POST['fvalue'] || $_POST['fvalue'] == " ") && !$multimandatory) //if the last question was mandatory but there is no data
{
//Repeat last question until an answer is shown
if ($move == " last ") {$move = " next >> ";} //avoids going to submit if last question isn't answered
Expand Down Expand Up @@ -1132,7 +1132,9 @@
echo "\t<tr>\n";
echo "\t\t<td colspan='2' align='center'>\n";
echo "\t\t\t<input type='hidden' name='lastfield' value='$fname' />\n";
echo "\t\t\t<input type='text' size='10' name='fvalue' value=\"{$_SESSION[$fname]}\" onKeyPress=\"return goodchars(event,'0123456789.')\"/><br />\n";
echo "\t\t\t<input type='text' size='10' name='fvalue' value=\"";
echo $_SESSION[$fname];
echo "\" onKeyPress=\"return goodchars(event,'0123456789.')\"/><br />\n";
echo "\t\t\t<font size='1'><i>Only numbers can be entered in this field</i></font>\n";
break;
case "S": //SHORT FREE TEXT
Expand Down

0 comments on commit 58402e5

Please sign in to comment.