I have following code added in a webform step's custom JavaScript. When click on Next button after validating some data I want to redirect to the next step but it doesn't work.
$(document).ready(function () {
webFormClientValidate = function () {
validateX(function(flag) {
return flag;
});
};
});
function validateX(callback) {
checkX()
.then((response) => {
if (!response) {
$('html, body').animate({
'scrollTop': $('.validation-summary').position().top
});
} else {
var entityId = $('#EntityFormView_EntityID').val();
return returnPromise1(entityId);
}
}).then((entityId) => {
if (entityId&& entityId.length > 0) return returnPromise2(entityId);
}).then((entityId) => {
if (entityId&& entityId.length > 0) {
callback(true);
}
else callback(false);
});
}
how can I redirect to the next step using these above code?