Hi all,
I need some help with saving dynamic generated form values to the database.
The form has 4 fields: a checkbox, "first name", "email" (textfield), "notes" (textfield)
Basically an admin needs to indicate which users attended a meeting, and also sometimes update their info on the fly.
So, a form gets generated full of names, depending on various criteria, like "age group" / "sex" / "city", etc. Thus the length and content of the forms can vary every time. The admin person then needs to tick the select box next to the name of the person attending, and sometimes update his info on the fly as well. The "Email" & "Notes" textfields are editable and I need to save the info in those textfields as well.
So, I have the following list:
Name Fistname Lastname Email Notes
John Doe
john@doe.net sick
Jane Smith
jane@blah.com
Joe Soap
joe@soap.tv on vacation
etc, etc.
I need to record:
a.) who attended - I got this working fine already
b.) all their updated info. - this is the one which I don't know how todo, since the list is dynamically generated.
For the checkboxes, I have the following:
Which then produces an HTML list as follows:
Then I capture the results as follows:
2 problem exists with this approach though:
1. Since both the "cid" & "notes" fields are arrays, I can't get join the data. i.e. I can't reliably see what notes were given with the corresponding users.
2. HTML doesn't submit non-checked checkboxes, so I don't get those rows' data. This also mean I don't get to capture the updated email address & notes for this user, even though he didn't attend. Basically, if a user is sick / on vacation / etc, then we still need to know why he didn't attend a meeting.
So, the question is, how do I capture a whole row in a dynamic table like this, and map the corresponding info to the right user / userid?
P.S. I took the email textfield out of the code to see if I can first get the "notes" field's info collected.
P.P.S. This is a Joomla component