Processing unknown amount of fields
Posted: Wed May 11, 2005 3:49 pm
Hello,
I am working on a project that will allow users to customize which questions they want to include on a survey.
The questions are stored in the database and are retrieved into a form like this:
My difficulty is trying to figure out how to process the fields since it will be an unknown amount of fields, plus unknown names. I saw a response to a question similar to this that mentioned changing the checkbox name to 'questionChoice[]' in order to make an array that could be processed. Could someone confirm that this would work? Or if someone has another idea that would work, I would appreciate hearing your comments/suggestions.
Thank you for your consideration.
I am working on a project that will allow users to customize which questions they want to include on a survey.
The questions are stored in the database and are retrieved into a form like this:
Code: Select all
while ($Row = mysql_fetch_array($questionResult)) {
print("<tr height=\"25\" align=\"left\">\n");
print("<td align=\"left\"><input type='checkbox' checked value='$Row[ID]' name='questionChoice' /></td>\n");
print("</tr>\n");
}Thank you for your consideration.