Hola! Soy Diana, y en este video, aprenderás como crear un formulario multi-step en Wix, usando código Velo y una dataset. No olvides subscribirte y comentar alguna pregunta!
$w.onReady(function () { //next buttons $w("#btnStarted").onClick(() => { loadNext(); }); $w("#btnEmail").onClick(() => { loadNext(); }); //back buttons $w("#btnEmailBack").onClick(() => { loadBack(); }); $w("#btnSaveBack").onClick(() => { loadBack(); }); }); //LoadNext: Load the next state from multi parameter function loadNext() { let MultiState = $w("#myStateBox"); //MultiState Box element const states = MultiState.states; //MultiState Box states let current = MultiState.currentState; //current state const indexCurrent = states.findIndex(state => state.id == current.id ); let indexNext = indexCurrent + 1; let next = indexNext < states.length ? states[indexNext].id : ''; //next id goToState(MultiState, next); } function loadBack() { let MultiState = $w("#myStateBox"); //MultiState Box element const states = MultiState.states; //MultiState Box states let current = MultiState.currentState; //current state let indexCurrent = states.findIndex(state => state.id === current.id ); let indexBack = indexCurrent - 1; //index of previous state let back = indexBack >= 0 ? states[indexBack].id : ''; //get index id goToState(MultiState, back); } function goToState(multi, id) { if (id != '') { multi.changeState(id); } }
Gracias por ver el vídeo!
Commentaires