I have a PHP generated page which displays X many records. Each record has
a checkbox preceding it. The user checks several checkboxes, and hits a
delete button. All the corresponding records will be deleted.
But I'm running into difficulty...
Right now the NAME property of each check box is the primary key of the
corresponding record. Hence if I know which checkboxes are checked, I
simply use DELETE using the NAME value.
Generally speaking, how do I get the server side to see which check boxes
were checked?
The check box names may not be sequential, if any records have been deleted
previously, and the first check box might be a number greater than 0.
Is there an easy mechanism to do this? Some kind of built in cnotrol array
allowing me to loop over every check box that was on the form submitted?
I could store the last and first checkbox number in a hidden input, then
loop starting/ending at those values, but that may loop over a lot of
controls that do not exist.
Thoughts?
<Ade
--
Adrian Parker. Ordained priest. <adrian.parker@ sympatico.ca>
"A society that views graphic violence as entertainment ...should not be
surprised when senseless violence shatters the dreams of it's youngest and
brightest..." - Ensign (March 2004)
a checkbox preceding it. The user checks several checkboxes, and hits a
delete button. All the corresponding records will be deleted.
But I'm running into difficulty...
Right now the NAME property of each check box is the primary key of the
corresponding record. Hence if I know which checkboxes are checked, I
simply use DELETE using the NAME value.
Generally speaking, how do I get the server side to see which check boxes
were checked?
The check box names may not be sequential, if any records have been deleted
previously, and the first check box might be a number greater than 0.
Is there an easy mechanism to do this? Some kind of built in cnotrol array
allowing me to loop over every check box that was on the form submitted?
I could store the last and first checkbox number in a hidden input, then
loop starting/ending at those values, but that may loop over a lot of
controls that do not exist.
Thoughts?
<Ade
--
Adrian Parker. Ordained priest. <adrian.parker@ sympatico.ca>
"A society that views graphic violence as entertainment ...should not be
surprised when senseless violence shatters the dreams of it's youngest and
brightest..." - Ensign (March 2004)
Comment