Hello, I have my multistate box coded where it's controlled by a drop down menu. I would like to add a back / forward button at the top that is static and is coded to move back or forward states when clicked.
$w('#selectcourse').onChange(() => {
if ($w('#selectcourse').value === "01") {
$w('#101statebox').changeState("1");
Any help is greatly appreciated! Thank you.
I will reply later... to be continued...
How is not complete? I've very new to Velo.
I tried this and it didn't work. I also tried to do export function buton_click(event) with those commands and resulted in nothing as well.
What am I missing?
Thank you!
This is a code-part of one of my sites, where i have exact your wished functionality.....
var counter = 1 $w.onReady(function () { $w('#btnNext').onClick(()=>{ counter=counter+1 let currentState = ("State"+counter) $w('#MSB1').changeState(currentState) if(counter>1) {$w('#btnPrevious').show()} }) $w('#btnPrevious').onClick(()=>{ counter=counter-1 let currentState = ("State"+counter) $w('#MSB1').changeState(currentState) if(counter===1) {$w('#btnPrevious').hide()} }) });
Modify this code to your own needs😉
"btn" ---> BUTTON
"MSB" ---> MultiStateBox
You will have to make it perfect, because this code is not complete.