OnClick function suppressing button link?

Hi there, I’m trying to add functionality that will disable a button after it has been clicked.

I’m able to get this disabling function to execute correctly, however when clicking the button now the link aspect no longer works?

I want the button to still direct to the link I have specified ( https://www.levyelectric.com/electric-scooters/levy ), but become disabled afterwards (essentially letting the user know they are already on that “tab” so to speak.

Currently it seems as soon as the button is clicked, it becomes disabled and the action of the button is no longer able to be run? Any thoughts are greatly appreciated.

You can see how this behaves now without the enable / disable code by visiting https://www.levyelectric.com/electric-scooters/levy .

Thanks you in advance for whoever might know a quick answer here.

export function button14_click(event, $w) {
$w(“#button14”).disable();
$w(“#button15”).enable();
}
export function button15_click(event, $w) {
$w(“#button15”).disable();
$w(“#button14”).enable();
}

Hi Eric,

Instead of configuring the page link and anchor in the dialog, you could do it in code.

https://www.wix.com/corvid/reference/wix-location.html#to