Boolean in wix database

I tried coding something that seems to be very simple but I’m not a good coder so I can’t get it to work. Someone with experience might be able to solve it easely.
This is what my page looks like.


This is the code that goes with the page


And here is the dataset that is linked to the custom form (there are later going to be multiple pictures, there is only one now for simplicty)


Customer 1 clicked the checkbox normally and sumbitted.
Customer 2 clicked on the image (checkbox appears to be checked) and submitted.
The database in customer 2 doesn’t show the checkmark. Why is that?
I want the database to show the tickmark even when clicking the picture.
Because later I want to hide the checkbox and let customers select a product via clicking the picture.
I tried to find a solution everywhere and can’t seem to find it.
Thanks for your help.

Hallo paltstoff,

That is how i would try to solve the problem…

  1. Create an “OnClick-Event” to the IMAGE. (onClickIMAGE do something —> [run function xxxxx])
  2. Create a function like this one…
function xxxxx() {
 let itemIndex=$w('#myDataset').getCurrentItemIndex()
 //for example itemIndex=3
    $w('#myDataset').setFieldValue("title", "here ---> TRUE/FALSE")
    $w('#myDataset').save()
}

It’s just an example, not tested!