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

Multiple checkbox form

I want to make a task list. The task are rows from a table. In the index.volt I can view the table and edit one row at the time but that not what I want.

How can i view the table, check multiple boxes and save.

tasktable=> fields: id, taskdescription, date Al my tasks are in this table.

I dont know if that work with Volt.

But normaly i would do that in Thymeleaf or Fluid or an other Tempalte Engine like this:

Build a Model which represent your form with a arraylist/Collection, which all contains the items. In Volt u set the Formmodel as the Object.

Iterrate true the Items and set the name and values dynamicaly.

Now u can send a object of that Formmodel from Volt to the Controller and and iterrate over the itemlist and handle the Items with his changes pro Item.

Maybe that give you a hint.



2.2k

Thank you, i will take a look.



2.2k

Is it possible to make a link of the checkbox. So when you klick the checkbox it links to a view where the controller change the value in the database (controller) or someting like that. It would be a nice solution because you don't have to klick the save button.