Hi
I have the foll code in a php script where I essentially display a form with checkboxes, and 2 text boxes associated with each checkbox to record grades ( marks and remarks ). The form displays correctly and the checkboxes I select do pass the correct id numbers for the students to be graded, also the numeric data in the first textbox is correctly transmitted HOWEVER the data in the second textbox gets randomly truncated. e.g, if the "remarks" textbox has 'hello', it gets truncated to 'o'. It seems I'm not resetting something or there is another simple oversight somewhere.
I check what I'm getting from the form using
if($submit) {
foreach($sel_student as $value) {
echo $marks[$value];
echo $remarks[$value];
}
}
and the form I am using contains :
$query = "SELECT students.name,classroster.id, reportmarks FROM students, classroster, reports WHERE students.id = classroster.id AND classroster.classid = '$classid' AND reports.reportid = '$reportid' ORDER BY students.name";
$result = mysql_query($query);
while ($row=mysql_fetch_row($result)) {
$id = $row[1];
echo "<tr>";
echo "<td><input type=\"checkbox\" name=\"sel_student[]\" value=\"$id\"></td>";
echo "<td>$row[0]</td>";
echo "<td></td>";
echo "<td><input type=\"text\" name=\"marks[$id]\"></td>";
echo "<td>out of $row[2]</td>";
echo "<td></td>";
echo "<td><input type=\"text\" name=\"remarks[$id]\"></td>";
echo "<td></td>";
echo "</tr>";
}
?>
</table>
<br>
<input type="Submit" name="submit" value="Enter Marks">
Please help!