javascriptgravity-forms-plugin

Is there a way to delay page redirect with javascript in Gravity Forms confirmation settings?


I am trying to delay URL redirect so that values on a spreadsheet can be done calculating before the redirect occurs. The redirect takes the form submitter to a page that shows updated information as a results of the form response.

Here is the script I am trying to include in the Text Editor of the confimation settings page:

<script type="text/javascript">
setTimeout(function() {
window.location = 'URL Here';
3500); // 3.5 seconds
</script>

The note from Gravity Forms is:

The text you have entered is not valid. For security reasons, some characters are not allowed. Fix it

When I click "Fix it", the script tags are removed by Gravity Forms, leaving me with this:

setTimeout(function() {
    window.location = 'https://intranet.onyxcollection.com/shop-management/home/lav-accessory-casting/';
    }, 3500); // 3.5 seconds

Is there a different approach to what I am trying to achieve, aside from modifying the PHP file which I have no access to since I am not the site administrator?


Solution

  • Including Javascript in a Gravity Forms confirmation is still possible. The issue I was experiencing was due to limitations imposed by Gravity Forms.

    Apparently, only SuperAdmins can add Javascript to the Gravity Forms confirmations. Once our team received this answer from the folks at Gravity Forms, my SuperAdmin added the Javascript snippet I gave him and everything now performs as expected.