How can I redirect to different URLs based on checkbox selections in Wix Velo?

Hi everyone,

I have a Wix site with several checkboxes representing different user issues. I currently check these issues on button click, and depending on which group of issues (testing1, testing2, testing3, testing4) the user selects, I display a message like “testing 1”, “testing 2”, etc.

Now, instead of showing text, I want to redirect the user to different URLs based on which testing group matches:

How can I implement this redirection behavior in Wix Velo after the button click?

Here’s the current code snippet that changes the text based on the testing group:

if (testing4) {
  $w('#sampleText').text = "testing 4";
} else if (testing3) {
  $w('#sampleText').text = "testing 3";
} else if (testing2) {
  $w('#sampleText').text = "testing 2";
} else if (testing1) {
  $w('#sampleText').text = "testing 1";
} else {
  $w('#sampleText').text = "";
}

Thank you in advance!

Using the wix-location-frontend API. It’s pretty easy - you’ll get a hang of it when you check out the examples provided in the docs.