I’m trying to submit a form through a custom front end, using AJAX and the GFAPI::add_entry function. I have data submitting but can’t seem to get checkboxes to store. There’s been a few topics I’ve found (here for eg) that reference using a different ID (i.e. ID_index) but I just can’t seem to get it right.
The code I’m running is GFAPI::add_entry($formEntry);
, where a var_dump
of $formEntry
just before submission gives the below.
array(5) {
["form_id"]=> int(30)
[59]=> string(0) ""
[1]=> string(3) "USA"
[5]=> string(2) "UK"
[12]=> array(1) {
[0]=> string(6) "Canada"
}
}
Fields 1 and 5 store as expected, but field 12 just won’t go in (that’s the checkbox list). Here’s a shot of the admin setup for reference.
I’ve tried having the object reference input_12_1
, 12_1
and various other combinations - any support would be greatly appreciated.
Thanks