Search code examples
formssymfony1checkbox

Symfony setting value of specific checkbox from db?


I want to set checkbox to be checked for form rendered for specific value alone which i have retrieved from database. I can do it in jQuery, but is there any specific library functions in Symfony?

Suggestions please...


Solution

  • you can try this....

    on showing the form in first you can also pass the value in form while setting

     $this->samplevariable = YOURFORM($this->getYOURMODEL->setYOURFORMFIELDNAME(array of values(1,2,3) which u get form db getYOURFORMFIELDNAME);