We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Multicheckbox

I want to accomplish this:

<form> <input type="checkbox" name="theCheckbox" value="1"/> Value one <input type="checkbox" name="theCheckbox" value="2"/> Value two <input type="checkbox" name="theCheckbox" value="3"/> value three </form>

and this is how I'm trying>

Controller: $tagsDataset= Tags::find(); foreach ($tagsDataset as $tag) $categoryTags[$tag->tag_id]=$tag->name_en;

$cbxCategoryTags=new Check('category_tags',$categoryTags); $form->add($cbxCategoryTags;

View.phtml $form->render('category_tags');

And it is only outputting the first element of the array.



58.4k

Hi theCheckbox replace to theCheckbox[]