|
Posted by Second_Chance on 11/03/26 11:16
How to deal with multiple records and posting values?
(I'm fairly new to html/php etc. so maybe there is a simple answer?
I have a page showing several records - each table record is contained
within a separate form and has action buttons that submit (for
update/delete etc).
I generate the html using a php loop, which adds the loop counter to
inputs name and id (to ensure unique id's).
This results in the $_POST array receiving results as "budgetname1", or
"budgetname2" etc.
Do I have to parse the POST array, when what i really want is just
"budgetname" in the POST array, no matter which record the user clicks
on (the values tell me what i need!).
Although the page works if I assign the same id's in each form, the HTML
spec seems to suggest that a) id's must be unique in the document, b)
that name and id must be the same, and c) that "[]" characters are not
permitted in HTML 4.01
So do I have to step thru the POST array checking all the keys looking
for a substring match of the key to "budgetname%" or similar??
I guess this must be a common problem with multi-row tables on a page,
but what's the best solution?
thanks
chris
Navigation:
[Reply to this message]
|