Multi-step form - 'go to step' code

I have designed a Multi-step form and didn’t realise Wix doesn’t offer a ‘go to step’ function. I am hoping a simple line of code like ‘onclick’ can be used to let a user skip ‘steps’ based on a button selection (ie Go to Step XZY). If anyone can offer suggestions that would be great.

$w.onReady(() => {
    $w('#someButton').onClick(() => {
        $w('#multiStateBox1').changeState('stateName');
    })
})
1 Like

thanks for your help. I will try it out. :slight_smile:

Hi J.D.
I added the code

$w . onReady (() => {
$w ( ‘#button262’ ). onClick (() => {
$w ( ‘#statebox2’ ). changeState ( ‘#stateboxFormState96’ );
})
})

The current is ‘stateboxFormState100’ and the button click should take me to ‘stateboxFormState96’.

I get this error:

Wix code SDK error: The “stateInfo” parameter that is passed to the “changeState” method cannot be set to the value #stateboxFormState96. It must be a state or a state ID from the “comp-kx5t50hm” state box
The “stateInfo” parameter that is passed to the “changeState” method cannot be set to the value #stateboxFormState96. It must be a state or a state ID from the “statebox2” state box.

The multiStepForm is ‘statebox2’ so why would the erorr occur?

I raised this problem with Wix and below is their unbelievalbe response:
'Please note that in case you want to create an extended multistage form, you would need to create it from scratch using Input Elements and Velo code.

To do so, remove the Wix Forms element and start adding the relevant elements to your page. ’

I’ve put in a huge amount of hours in designing this multistage form, is it really impossible to get around this problem, or are they too inept to bother offering a solution? If anyone can please tell me if I’m expecting too much?

@gmsutton101 the state name is wrong.
A state name never starts with # symbol.

Hi JD.

Sorry for my ignorance. :slight_smile:
it worked. THANKYOU.

1 Like