user2680614 user2680614 - 3 months ago 8
jQuery Question

Fix input errors and continuation issues in validation form

I have a form that will not show errors when the wrong text is input and won't continue on to the next step after selecting next.

Here is how it's supposed to function (scroll to bottom): http://infinite-woodland-5276.herokuapp.com/forms-validation.html

Here is the Fiddle: https://jsfiddle.net/j31qm806/3/

init.push(function() {
$('#wizard-forms').pixelWizard({
onFinish: function() {
// Disable changing step. To enable changing step just call this.unfreeze()
this.freeze();
}
});
$('#wizard-forms .wizard-prev-step-btn').on('click', function() {
$('#wizard-forms').pixelWizard('prevStep');
return false;
});

Answer

you missed

var init = [];

from the start of your code. This is present right at the top of the source of the demo you linked to.

You've also missed

window.PixelAdmin.start(init);

from the end of your code.

Both those statements need to be outside any kind of window.onload / $(document.ready() type function - but everything else should be inside it.

See a working example at https://jsfiddle.net/j31qm806/21/