Automatically redirecting to next step after displaying text or a progress bar

Below code is intended if you want to display a progress bar (or some text) like "Comparing the best offers for you……" inside a multi-part (form step) before automatically redirecting to the next step

The below code can (or should be) placed inside a HTML (raw) element. It will then be loaded only when the form itself is loaded. Just make sure to uncheck the "Automatically add line-breaks" so that it doesn't corrupt the JavaScript code.

Inside the below code you can change the milliseconds 5000 to something different so it shows the text longer or shorter depending on your use case. Replace the step===3 with the step number that is displaying the text or progress bar.

This code can of course be altered for other use cases as well. For questions you can always contact support.

  function hashChanged(storedHash){
    if(storedHash.indexOf('#step-')===-1) return;
    var currentStep = location.hash.substring(1);
        var form, explodedStep = currentStep.split('-');
        if(explodedStep[0]==='step' && currentStep[4]==='-'){
            var stepFormID = explodedStep[1];
            form = document.querySelector('#super-form-'+stepFormID);
                var multiPart = explodedStep[2].split(';');
                var step = Number(multiPart[0]);
                    // Redirect to step 4 after X seconds
                        currentStep = 'step-'+stepFormID+'-'+(step+1);
                        window.location.hash = currentStep;
                        SUPER.switch_to_step_and_or_field(form, currentStep);
  if("onhashchange" in window) {
    window.onhashchange = function () {
    var storedHash = window.location.hash;
    window.setInterval(function () {
      if (window.location.hash != storedHash) {
        storedHash = window.location.hash;
    }, 100);

Last updated