PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Works in preview not on site

  1. Edtek
    Member

    I have created the following form:

    http://shirleyborrelli.com/authentic-style-that-is-congruent-with-your-brand/

    After submission it is supposed to re-direct to another page:

    http://shirleyborrelli.com/authentic-style-call-in-details/

    For some reason in preview mode, it works flawlessly, yet when live on the site it records the entry but does not forward the user on to the new page. I can't see anything wrong, and I don't believe there are any script errors.

    Posted 13 years ago on Wednesday October 12, 2011 | Permalink
  2. You have AJAX enabled and the reason why it doesn't appear to work is because it's not. The form isn't submitting. The problem is none of the Gravity Forms scripts or CSS are being enqueued on the page.

    If you are using the shortcode in post or page content it will enqueue the scripts automatically. But only if it's executed in a standard loop. Because of how enqueue works if your theme is put together in a non-standard way, you may have to manually enqueue the necessary scripts.

    If you are using the form widget in a sidebar, it will output the scripts automatically.

    If you are using the function call directly in the PHP theme template, it does not automatically enqueue scripts because the function can be executed anywhere and therefore it can't enqueue scripts automatically due to how WordPress executes.

    I don't know how you have this page setup as it doesn't look like a traditional WordPress page and is more of a standalone splash page. So i'm not sure which of the 3 scenarios above you are using. My guess it's either 1 or 3 above.

    If you are using the shortcode and it's not enqueuing it could also be because the theme template is missing the required wp_head() function call in the header.php or wp_footer() function call in the footer.php file.

    You may need to manually enqueue the necessary scripts. There is another function you use to do this. You would place this function call in your themes functions.php file, and wrap it in an if statement so it only executes if the page/post id matches this page so it's not output everywhere.

    Documentation for the Gravity Forms enqueue function can be found here:

    http://www.gravityhelp.com/documentation/page/Gravity_form_enqueue_scripts

    General information on properly embedding a form can be found here:

    http://www.gravityhelp.com/documentation/page/Embedding_A_Form

    Posted 13 years ago on Wednesday October 12, 2011 | Permalink
  3. Edtek
    Member

    Thanks, it seems turning off ajax corrected the issue.

    Posted 13 years ago on Thursday October 13, 2011 | Permalink
  4. rfair404
    Member

    Similar, but not quite the same issue. I can't even submit the form, it just clears and does not register the entry, or redirect to the thank you page. On preview it works for whatever reason. I have ajax off. here is the link: http://www.wellcentive.com/contact-us

    Posted 13 years ago on Friday October 14, 2011 | Permalink
  5. rfair404, you need to start by checking for theme or plugin conflicts. http://www.gravityhelp.com/documentation/page/Testing_for_a_Theme/Plugin_Conflict

    The reason it works from the preview is that your theme and probably most of your plugins are not active. Try with the default Twenty Eleven theme and see if that works first. If not, it will be a plugin conflict. When you find the offender, please post the name here.

    Thanks

    Posted 13 years ago on Friday October 14, 2011 | Permalink
  6. rfair404
    Member

    yeah I did all that. With twentyeleven active and all other plugins off, it still does not work. Bonkers.

    Posted 13 years ago on Friday October 14, 2011 | Permalink
  7. If it works in preview mode, but not in your live site, it's normally something with a plugin or a theme file. Can you export the form and install it on another site you have access to, to see if it works there?

    For the confirmation, are you using a message or redirecting to a page? If redirecting to a page, does the page exist?

    Posted 13 years ago on Friday October 14, 2011 | Permalink