• Resolved moderworks

    (@moderworks)


    Hello,

    I have encountered an issue with the redirect to the specified page in the admin panel after a form is successfully submitted on the website. Users do not have enough time to read the confirmation message before being redirected. Could you advise what and where to modify in the code to add a 5-second delay for the redirect?

    Thank you for your assistance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WP Shuffle

    (@wpshuffle)

    Hello there,

    Thank you for writing to us. Currently that is not configurable from the plugin settings but you can modify one of our plugin files to add the delay as you had mentioned.

    Please open one of our plugin file inside our plugin’s assets > js > fpsml-frontend.js and replace line number 308 and 309 with below block of code.

    setTimeout(function () {
    window.location = data.redirect_url;
    exit;
    }, 5000);

    Please adjust 5000 into your desired number as per the delay you want. 5000 refers to 5 seconds of delay.

    We will come up with this feature in the backend so that you won’t need to worry regarding updating the plugin.

    Thanks.

    Thread Starter moderworks

    (@moderworks)

    Okay. Thanks for the quick response! I have already found this place in the code and changed it to:

    if (!data.draft_post_id) {
    fpsm_reset_form(selector);
    if (data.redirect_url) {
    if (data.redirect_delay) {
    setTimeout(function () {
    window.location = data.redirect_url;
    }, data.redirect_delay);
    } else {
    setTimeout(function () {
    window.location = data.redirect_url;
    }, 3500);
    }
    return;
    }
    } else {
    selector.find('.fpsm-edit-post-id').val(data.draft_post_id);
    if (data.redirect_url) {
    if (data.redirect_delay) {
    setTimeout(function () {
    window.location = data.redirect_url;
    }, data.redirect_delay);
    } else {
    setTimeout(function () {
    window.location = data.redirect_url;
    }, 3500);
    }
    return;
    }
    if (selector.find('#g-recaptcha-response').length > 0) {
    grecaptcha.reset();
    }
    }

    I hope this is correct.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.