Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

In this Discussion

Vanilla 2.6 is here! It includes security fixes and requires PHP 7.0. We have therefore ALSO released Vanilla 2.5.2 with security patches if you are still on PHP 5.6 to give you additional time to upgrade.

Multiple values in checkbox

Hi,
Just wondering if you can help.
I have a checkbox name 'fruit' that has multiple values e.g. apple, orange, grape
I'm looking to select multiple values and send this to a SQL table. Let's say I select all three fruits.
My problem is every time I send to the SQL table, it always display the number 1 in the field instead of "apple, orange, grape"

This is the PHP code I used:

echo $this->Form->Checkbox('Fruit', 'apple');
echo $this->Form->Checkbox('Fruit', 'orange');
echo $this->Form->Checkbox('Fruit', 'grape');

Any help would be appreciated.

Thank you

Comments

Sign In or Register to comment.