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

how to use multiple checkbox in phalcon

echo $this->tag->checkField( array( "floortypes", array( 'Wood'=>'Wood', 'Granite'=>'Granite', 'Marble'=>'Marble', 'Laminate'=>'Laminate', 'Carpet'=>'Carpet', 'Tile'=>'Tile', 'Other'=>'Other' ), "class" => "form-control", ) );

                            this is my old code


43.9k

Hi,

try with:


echo $this->tag->checkField( array( "floortypes[]", 'Wood'=>'Wood') );
echo $this->tag->checkField( array( "floortypes[]", 'Granite'=>'Granite') );

according to https://www.formget.com/php-checkbox/

but I didn't try it ...

I think this is how you do it. Just remember to specify the value for each checkbox and you are good.

Hi,

try with:


echo $this->tag->checkField( array( "floortypes[]", 'Wood'=>'Wood') );
echo $this->tag->checkField( array( "floortypes[]", 'Granite'=>'Granite') );

according to https://www.formget.com/php-checkbox/

but I didn't try it ...