I'm not sure whether this question demands a JavaScript answer or a
simple HTML one - so apologies for the cross posting.
I am grabbing a bunch of data from MySQL using PHP and returning the
results, row by row, to the user. These results are returned in a form
(for editing) and then submitted back out again as an array (since the
field names are repeated), e.g :
<form type="text" name="subject[]">
<form type="checkbox" name="delete[]">
... plus many others.
My problem is that when the user makes the requested changes, and ticks
the 'delete' checkbox to X number of fields, those checkboxes which are
not checked post no data (is that correct?).
I verified this with "print_r($_POST)" (in PHP) and find that although
there is an array of all the data rows (subject[0] ; subject[1] etc...)
there only exists the 'delete' items which are checked, and needless to
say the array will then start from 0 and go up sequentially - so it
wouldn't match.
Hence regardless of which rows are marked for deletion, it's always the
first few which end up being deleted.
How (if possible) do I get the 'delete' values to correspond to the
correct position in the array? Or is there a better way of achieving this?
Many thanks,
Terence