Not sure the title says what I mean...
I'm working on an image uploader/manager script. When images are uploaded, their details are kept in a database so I can store alt text and control the order images are displayed in etc.
To do this I'm trying to create a form where I can update multiple records at once with different info(alt text for each picture(record), and the order number the picture should display in)
So I've named the form fields that hold the sort-order and Alt text like so:
image[$imageid][order] image[$imageid][alt]
or
<input name="image[48][order]" type="text" value="3" size="2" maxlength="2" />
<input name="image[48][alt]" type="text" value="Some text here." size="33" maxlength="200" />
A form could have many of these, the above two fields for each image in the database like so:
image[45][order] value="1" image[45][alt] value="Man ordering sports car."
image[11][order] value="2" image[11][alt] value="Sports car ariving."
image[27][order] value="3" image[27][alt] value="Sports car with driver."
image[21][order] value="4" image[21][alt] value="Car crash. Driver speeding."
I can update the two fields per record fine, my problem is that when attempting to do the update one of the fields might not pass validation. When that happens normally I simply pass that variable back to the form field it came from along with an error message. But submitting the form fields with the names above which is needed to place them into arrays for the update, I don't know how to call the appropriate variable to place it back in the form field it came from if the form validation fails at some point.
So how do I get image[27][order] to output it's value back to the form field that submitted it?
Thanks,
Peter