Vorbly <Code>

CODING MADE EASY WITH VORBLY

WIX CODE CHANGE BUTTON LINK (WIX PAGES)

Need to change button links for different scenarios? This tutorial will show you how to change button links for different scenarios using Wix Code. You will be able to direct visitors to different webpages based on their user input. We will provide you with the webpage elements and sample codes required to implement this feature.

THE DEMO

1/1

THE ELEMENTS

The Page

User Input: #dropdown1​​

Button Element: #BookNow

 

Wix Pages: 

  • Online Payment Page: /payment

  • Order Form Page: /reservation

THE CODE

Page Code

import wixLocation from "wix-location";

 

export function BookNow_click(event, $w) {

 

        let option = $w("#dropdown1").value;

 

        if ( option === "Pay Now" ) {

             wixLocation.to("/payment");

        } else {

             wixLocation.to("/reservation");

    }

}

COMMENTS

I'm a paragraph. Click here to add your own text and edit me. It's easy.

WEB DESIGN & DEVELOPMENT SOLUTIONS

GET PROFESSIONAL HELP