Hi,
I have a form which with a checkbox field. I have an existing gform_post_submission function for this form, which takes several single value fields and builds them into an array. That's no problem and is working fine.
This is where I am stumped.
- I have a multiselect field (checkboxes) which is populated by a query.
- I need to get the selected values of this field into an array.
- There is an unknown number of checkboxes, anything from 1 to dozens - if needs be I could get a count and stick it into a hidden field so at least I'd know that at the post submission stage.
However I am not clear how (or if) I can get the selected choices of a multiselect field to build this array. I suppose I am looking for something vaguely like
foreach($choices as $choice) {
if($isselected) {
// add value to array
)
}
Is it possible to do this? Any pointers?