Vorbly <Code>
CODING MADE EASY WITH VORBLY
WIX CODE COLLAPSE OR EXPAND FORM OPTIONS
Need to customize your user forms and menus? This tutorial will show you how to use a Switch button to collapse (or expand) form options or menus. You will be able to streamline your online forms and show only relevant options. We will provide you with the webpage elements and sample codes required to implement this feature.
THE DEMO
THE ELEMENTS
The Page
Switch Button: #switch1
User Inputs:
-
Email Field ID: #email
-
Radio Buttons (Interests): #radioGroup1
-
Radio Buttons (Frequency): #radioGroup2
Submit Button: #submit
THE CODE
Page Code
export function switch1_change(event) {
let option = $w("#switch1").checked;
if (option === false){
$w("#group1").collapse();
} else {
$w("#group1").expand();
}
}
COMMENTS
I'm a paragraph. Click here to add your own text and edit me. It's easy.