I am working on a system that allows the user to preview the result as an HTML table. I put a checkbox in the leftmost cell that is checked by default. Should the user uncheck any row, that row will not appear in the final product.
Submitting this form, which as of now is only these checkboxes, with just HTML yields a 404 error. Removing or significantly reducing the number of the checkboxes fixes this problem.
I implemented name = "checkbox[]"
instead of name = "checkbox1", name = "checkbox2", ...
to see if that would solve the problem; it didn't.
I also tried serializing and submitting the form data with jQuery post and PHP, which still gives me the 404. I tried submitting the form using AJAX and jQuery to the same effect.
I'm not sure if submitting the data through $_SESSION
will help. I don't know how I would implement this in my use case.
How can I submit many inputs without causing an error?
EDIT: A hopefully minimal, complete and verifiable example (using only HTML, since none of the scripting methods produced a better result):
<?
print "<form action = 'target.php' method='get'>";
for( $i = 0 ; $i < 200 ; $i++ ){
print '<input type="checkbox" name="chk[]" checked /> Checkbox ' . $i . '<br />';
}
print '<input type="submit" value="Submit">';
?>
This produces the same error for me: 404.