Show array value in checkboxes & save array key in Email and Database

ma mauropiro 18 Sep, 2018
Hello,
​
I have a form with the checkboxes component that receives the following array from my <clients> database table (read_data):
​
Array(
[david@company.com] => DAVID
[renata@company.com] => RENATA
)
​
On the browser I can see two check boxes: DAVID and RENATA, but in the email and in the database I need to be written:
​
david@company.com, renata@company.com
​
How can I do that?
​
Thank you
​
Mauro
Gr GreyHead 19 Sep, 2018
1 Likes
Hi Mauro,
​
The simplest way is probably to set the dropdown values to be the email addresses; though ideally it is better not to show those in the form where they are visible to be scraped. An alternative solution is to add a Custom PHP action to look up the addresses and add them to the form data. There is a FAQ that shows you how to do that.
​
Bob
he healyhatman 20 Sep, 2018
Just have the checkboxes as DAVID:DAVID etc, then read the database to get the email addresses when you need them.
This topic is locked and no more replies can be posted.