I have a form that dynamically prints out names based on a unique name tag. To be used for responding on invitations. There can be multiple users for each name tag, i.e. couples, couples with children, etc. For each name there is a radio-button where the invitee can select whether he/she is coming to the party or not (has the value 1=not coming, 2=coming). It can look like this, for a couple:
Lady Mary S
I am not coming - radio - value 1
I am coming - radio - value 2
Mister Hans S
I am not coming - radio - value 1
I am coming - radio - value 2
Child of Mary & Hans S
I am not coming - radio - value 1
I am coming - radio - value 2
Each of these invitees has a user id - I need the reponse to be with the user id. The HTML for it looks like this:
<div>
<h1>Lady Mary S</h1>
<label for="no-1">I am not coming</label>
<input type="radio" value="1" id="no-1" name="response[1]" /><br />
<label for="yes-1">I am coming</label>
<input type="radio" value="2" id="yes-1" name="response[1]" />
<input type="hidden" name="userid[]" value="1" />
</div>
<div>
<h1>Mister Hans S</h1>
<label for="no-2">I am not coming</label>
<input type="radio" value="1" id="no-2" name="response[2]" /><br />
<label for="yes-2">I am coming</label>
<input type="radio" value="2" id="yes-2" name="response[2]" />
<input type="hidden" name="userid[]" value="2" />
</div>
<div>
<h1>Child of Mary & Hans S</h1>
<label for="no-3">I am not coming</label>
<input type="radio" value="1" id="no-3" name="response[3]" /><br />
<label for="yes-3">I am coming</label>
<input type="radio" value="2" id="yes-3" name="response[3]" />
<input type="hidden" name="userid[]" value="3" />
</div>
These names will be fetched from MySQL with a unique nametag for these 3 people, f.x. MARHAN
This is a dynamic form - for some nametags there will only be two invitees and for other nametags there will be 3 or 4, etc.
My problems is that I cannot come up with a solution on how to handle the posted data so I can make sure the reponse is for the right user id.