Skip to content

Commit

Permalink
Added numerical question type
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@248 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Apr 20, 2003
1 parent 3b8ba99 commit f8d1584
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions admin/dataentry.php
Expand Up @@ -601,6 +601,11 @@
echo "</table>\n";
$i--;
break;
case "N": //NUMERICAL TEXT
echo keycontroljs();
echo "\t\t\t<input type='text' name='{$fnames[$i][0]}' value='{$idrow[$fnames[$i][0]]}' ";
echo "onKeyPress=\"return goodchars(event,'0123456789.')\" />\n";
break;
case "S": //SHORT FREE TEXT
echo "\t\t\t<input type='text' name='{$fnames[$i][0]}' value='";
echo htmlspecialchars($idrow[$fnames[$i][0]], ENT_QUOTES) . "' />\n";
Expand Down Expand Up @@ -1172,6 +1177,10 @@
}
echo "</table>\n";
break;
case "N": //NUMERICAL TEXT
echo keycontroljs();
echo "\t\t\t<input type='text' name='$fieldname' onKeyPress=\"return goodchars(event,'0123456789.')\" />";
break;
case "S": //SHORT FREE TEXT
echo "\t\t\t<input type='text' name='$fieldname' />\n";
break;
Expand Down
8 changes: 8 additions & 0 deletions index.php
Expand Up @@ -1119,6 +1119,14 @@
echo "\t\t\t<input type='hidden' name='multi' value='$anscount' />\n";
echo "\t\t\t<input type='hidden' name='lastfield' value='$multifields' />\n";
break;
case "N": //NUMERICAL QUESTION TYPE
echo keycontroljs();
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<font size='1'><i>Only numbers can be entered in this field</i></font>\n";
break;
case "S": //SHORT FREE TEXT
echo "\t<tr>\n";
echo "\t\t<td colspan='2' align='center'>\n";
Expand Down

0 comments on commit f8d1584

Please sign in to comment.