Why Does This Multiple Row Table Submit By Row? Is This Correct?
Here's a snip of table code found within a form. The rows are 'identical'. The inputs are all named alike. The submit buttons are all named alike. Each row contains
Besides, if you wanted to get all the values of
Solution 1:
As stated in another question on SO (relative since it is about hidden
inputs) :
The browsers are OK with it. However, how the application library parses it may vary. Programs are supposed to group identically named items together. While the HTML specification doesn't explicitly say this, it is implicitly stated in the documentation on checkboxes.
So this is just pure luck : Working with another server-side technology may get you another result.
For more information about what you could get, check this answer on another question. It has a lot of useful information and specs.
Besides, if you wanted to get all the values of
name="first"
, you would better name them like name="first[]"
.
Then you will have on the server $_POST["first"]
as an array you can loop through.
Post a Comment for "Why Does This Multiple Row Table Submit By Row? Is This Correct?"