Closed garethredfern closed 3 years ago
Can you show me how you want to set up the checkboxes? Is the name an array?
<input type="checkbox" name="foo[]" value="bar">
Hi Eric, yes sure, i am wanting to do as you describe above my form code is:
<div class="checkboxes">
<label><input type="checkbox" name="checkboxes[]" class="checkbox" value="Google Apps"> Google Apps Business Email</label>
<label><input type="checkbox" name="checkboxes[]" class="checkbox" value="Google Analytics"> Extended Google Analytics Support</label>
</div>
There will be more checkboxes added in time so I would like the ability to have as many checkboxes as I like. If I use the form with this code it just posts the word "Array" at the moment.
Can you try that pi.email_form.php that I committed above in the post-arrays branch. I think that should get you fixed up.
Hi Eric, I gave the post-arrays branch a try and I am still getting the following posted in the message instead of the checkbox names and vales:
checkboxes: Array
Okay, I will do some further testing.
-- Eric
Hi Eric, would it be possible to add in checkbox submission? I have had a play round with the code but have come to a bit of a dead end. I am guessing there needs to be some kind of for each loop adding so that all the items from the checkbox array get posted?