I’m rebuilding a site in Wappler which was previously built in Wordpress. The data in Wordpress stores multiple options in single fields, eg.
Red
Blue
Green
are stored as
Red|Blue|Green
The would be a form containing checkboxes for each colour.
Can I keep this same structure? Or would I be better going through the data and using a many-to-many table instead? If I was started from scratch then I would use the many-to-many table option but because I’m running with the existing data, I need to decide the best approach.
If I can keep to the same piped data structure, is it easy to create the checkbox forms to add/update records?
Hope I’ve explained this clearly enough. Thanks in anticipation.
Thanks @George, I thought this would probably already have been thought of
I’ve now spent a while trying to implement it but it’s not working. Would anyone be able to do a quick tutorial on the process of…
Displaying checkboxes from a database (I have a table containing airport names and want to list those as checkboxes so any number of them can be checked and the results get inserted in the database as a pipe-separated field)
Creating the Server Action to take the posted values, join them with pipes and insert into the table
In my form I have:
Form Group
Checkbox Control
Checkbox Input
The various places where dynamic details need to be added is confusing me somewhat! I’ve searched all over this community but just can’t get the finer details I need to make it work.
So far I have:
Added a repeat to the Checkbox Control
Set the Name of the Checkbox Input to airport[]
Set the Checkbox Input Value to the airport name from the loop
Set the Label also to the airport name from the loop
I’m seeing all the airports listed correctly with a checkbox next to each one but when I click on any airport label, the first checkbox toggles.
Thanks @Teodor, that makes perfect sense. I guessed the id was the issue but couldn’t see how to resolve it.
I’ve hand-coded your changes and it seems to be working as it should. I’m not seeing anything in the App Structure properties, though. Should I? Or is this a solution that can only be done with hand-coding?