I have a form that I allows the user to create a list of names. I need to also allow them to designate an rsvp status for an event for each name.
Here is the section of the form:
<li>
<div id="dynamicInput">
Name 1<br><input type="text" name="myInputs[]"> Attending Brunch? Yes<input name="attending[]" type="checkbox" value="Attending Brunch" /> No<input name="notattending[]" type="checkbox" value="Not Attending Brunch" /><br>
Name 2<br><input type="text" name="myInputs[]"> Attending Brunch? Yes<input name="attending[]" type="checkbox" value="Attending Brunch" /> No<input name="notattending[]" type="checkbox" value="Not Attending Brunch" /><br>
Name 3<br><input type="text" name="myInputs[]"> Attending Brunch? Yes<input name="attending[]" type="checkbox" value="Attending Brunch" /> No<input name="notattending[]" type="checkbox" value="Not Attending Brunch" /><br>
Name 4<br><input type="text" name="myInputs[]"> Attending Brunch? Yes<input name="attending[]" type="checkbox" value="Attending Brunch" /> No<input name="notattending[]" type="checkbox" value="Not Attending Brunch" /><br>
Name 5<br><input type="text" name="myInputs[]"> Attending Brunch? Yes<input name="attending[]" type="checkbox" value="Attending Brunch" /> No<input name="notattending[]" type="checkbox" value="Not Attending Brunch" /><br>
</div>
<input type="button" value="Add another volunteer" onClick="addInput('dynamicInput');">
</li>
This is the php that is returning the information in an email:
$myInputs = $_POST['myInputs'];
foreach ($myInputs as $eachInput) {
$message .= $eachInput . " - " ;
}
$attending = $_POST['attending'];
foreach ($attending as $moreInput) {
$message .= $moreInput . "<br><br>";
}
$notattending = $_POST['notattending'];
foreach ($notattending as $moreInput) {
$message .= $moreInput . "<br><br>";
}
$contact = $_POST['contact'];
$from = "$name <$email>";
$to = $_POST['recipient']; //"kim@ka-kingdesigns.com";
$subject = "Day of Caring Team Registration".$_POST['subject'];
$comments = "
<strong>Team Members</strong><br> {$message}<br><br>;
Right now it return info entered like this:
Team Members Kim - Attending Brunch - Donovan - - - - Not Attending Brunch
I need it to return like this:
Team Members
Kim - Attending Brunch
Donovan - Not Attending Brunch
Can anyone help?