Can members save switch settings?

Hey, I’m very new to Corvid but have started using it for a new project I’m working on.
Here’s what I’m trying to do:

I’m trying to create a checklist for members where they can save their progress. It’s a type of online course, split into different parts. In “Part 1” for example, they may watch a few videos and once complete, I want them to be able to tick a box and save their progress. So over the course of a few months they can work through and tick off all the sections.

In addition to this, I would love the “tick box” to change an image - I have managed to do this by reading this forum. I have a switch that swaps images (see attached video), using this code:

$w.onReady(function () {
$w("#switch1").onClick(() => {
if ($w("#switch1").checked) {
$w("#image1").show()
$w("#image2").hide()
} else {
$w("#image2").show()
$w("#image1").hide()

So ideally, I’d like the page to have a row of images with switches underneath, that they can click, it swaps the image and they can save their progress, so that next time they log on they can see what they’ve already completed. I hope that makes sense.

Is there a way of doing this? I just need the site to remember and show which switches the specific member has clicked.

Thanks in advance! Tim

Hi.

I would recommend replacing onClick event with an onChange event in your code and inside the onChange event code insert the status of the switch to a database collection as a boolean value.

Good luck!