I’m making a site with an application form, I followed this tutorial “WIX Tutorial | Simple Advance Multi-step Form with Progress Bar using Velo Code | Wix Ideas” by Wix Ideas
and everything seemed to work fine during testing. . . Except the submit button doesn’t work! I’m stuck in the beforeSave event and it won’t move anymore.
I’m lost on how to correct this, my button is linked to my dataset as well and it’s not saving to anything when tested
My code is:
$w.onReady(function () {
//NEXT BUTTONS
$w('#nextbutton1').onClick(function () {
$w('#auditionMultiStateBox').changeState("AboutYou")
$w('#progressBar1').value = 25;
$w('#progressbutton2').enable();
$w('#anchor1').scrollTo();
})
$w('#nextbutton2').onClick(function () {
$w('#auditionMultiStateBox').changeState("VTubing")
$w('#progressBar1').value = 50;
$w('#progressbutton3').enable();
$w('#anchor1').scrollTo();
})
$w('#nextbutton3').onClick(function () {
$w('#auditionMultiStateBox').changeState("ContentCreation")
$w('#progressBar1').value = 75;
$w('#progressbutton4').enable();
$w('#anchor1').scrollTo();
})
// PREVIOUS BUTTON IS -25
$w('#backbutton1').onClick(function () {
$w('#auditionMultiStateBox').changeState("PersonaDetails")
$w('#progressBar1').value = 0;
$w('#progressbutton2').disable();
$w('#anchor1').scrollTo();
})
$w('#backbutton2').onClick(function () {
$w('#auditionMultiStateBox').changeState("AboutYou")
$w('#progressBar1').value = 25;
$w('#progressbutton3').disable();
$w('#anchor1').scrollTo();
})
$w('#backbutton3').onClick(function () {
$w('#auditionMultiStateBox').changeState("VTubing")
$w('#progressBar1').value = 50;
$w('#progressbutton4').disable();
$w('#anchor1').scrollTo();
})
//PROGRESS BUTTONS
$w('#progressbutton1').onClick(function () {
$w('#auditionMultiStateBox').changeState("PersonaDetails")
$w('#progressBar1').value = 0;
})
$w('#progressbutton2').onClick(function () {
$w('#auditionMultiStateBox').changeState("AboutYou")
$w('#progressBar1').value = 25;
})
$w('#progressbutton3').onClick(function () {
$w('#auditionMultiStateBox').changeState("VTubing")
$w('#progressBar1').value = 50;
})
$w('#progressbutton4').onClick(function () {
$w('#auditionMultiStateBox').changeState("ContentCreation")
$w('#progressBar1').value = 75;
})
//VALIDATIONS:⚠
$w('#firstname, #email, #hearabout, #timezone, #age').onChange(function () {
if ($w('#firstname').value.length > 0 && $w('#timezone').value.length > 0 && $w('#hearabout').value.length > 0 && $w('#email').value.length > 0 && $w('#age').value.length > 0) {
$w('#nextbutton1').enable();
} else { $w('#nextbutton1').disable(); }
});
$w('#aboutyourself, #weakness, #inspire, #likes').onChange(function () {
if ($w('#aboutyourself').value.length > 0 && $w('#weakness').value.length > 0 && $w('#inspire').value.length > 0 && $w('#likes').value.length > 0 && $w('#age').value.length > 0) {
$w('#nextbutton2').enable();
} else { $w('#nextbutton2').disable(); }
});
$w('#experience, #favorite, #lore, #upload').onChange(function () {
if ($w('#experience').value.length > 0 && $w('#favorite').value.length > 0 && $w('#lore').value.length > 0 && $w('#upload').value.length > 0) {
$w('#nextbutton3').enable();
} else { $w('#nextbutton3').disable(); }
});
$w('#teams, #events, #links').onChange(function () {
if ($w('#teams').value.length > 0 && $w('#events').value.length > 0 && $w('#links').value.length > 0) {
$w('#submitbutton1').enable();
} else { $w('#submitbutton1').disable(); }
});
//SUBMIT BUTTON
$w('#submitbutton1').onClick(function () {
$w('#submitbutton1').label = "Submitting"
});
//AFTER SAVE
$w('#dataset1').onAfterSave(function () {
$w("#submitbutton1").label = "Submitted"
$w('#auditionMultiStateBox').changeState('SubmitSuccess')
$w('#progressBar1').value = 100;
$w('#anchor1').scrollTo();
});
//ON ERROR
$w('#dataset1').onError(function () {
$w('#submitbutton1').label = "submit";
});
});