Back to Form Builder Support

Page reloads after the form submitting

Post a reply
7988 views
marina956813648
marina956813648

Good day! Each time when I submit the form, the entire page reloads. This form is at the bottom of a long one page website, and when the page reloads, the user is taken away from the form and back up to the top of the page. How can I prevent this? Please help me. Thanks, Marina.

Renatio
Renatio

Hi,

check layout, if you have following code included:

{% framework extras %}
{% scripts %}

Do you have any errors in browser console?

marina956813648
marina956813648

Yes. This code included in layout. This is files which I get at the page bottom:


"/modules/system/assets/js/framework.js"
"/modules/system/assets/js/framework.extras.js"
"/modules/system/assets/css/framework.extras.css" 
"[my website]/plugins/renatio/formbuilder/assets/js/form.js"

I didn't get any errors from what I was able to see before the page reloads. Page begins reloading immediately so I do not have time to check the console or networks.

Last updated

Renatio
Renatio

Ok, also check do you have jQuery included in your javascript files before framework.js.

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>

Open browser console and click Preserve log button (Chrome) that will prevents logs from refreshing after page reload.

You can send me a message by October website:

http://octobercms.com/author/Renatio

and write me your website url, that I can check this for you.

marina956813648
marina956813648

It is works. Thank you very much for awesome support.

maxacarvalho
maxacarvalho

hi, I am having the same issue. My page keeps reloading after the form is send. You can test here: http://dev.ogvapers.com

The redirect option for the Component in my page is set to: -- none --

Renatio
Renatio

Hi,

this is common behaviour to reload page after successfull form request has been made.

Write me a private message, so I can send you solution for your one page site.

http://octobercms.com/author/Renatio

mberizzo
mberizzo

Hi! yesterday I bought your plugin... have the same behavior... what is the solution?? thanks!

Renatio
Renatio

I assume that you have one page and your form is working (email is successfully sent), but you don't want to reload the page after submission.

So to accomplish this you must do the following:

1/ Override default component partial.

a) create folder in your theme: partials/renderForm/

b) copy file /plugins/renatio/formbuilder/components/renderForm/default.htm into that folder

c) edit /partials/renderForm/default.htm file, add comma after line 25, add this code after line 25:

'data-request-success': "if (data.X_OCTOBER_REDIRECT !== undefined) { $('body').removeClass('oc-loading'); $('.stripe-loading-indicator').addClass('loaded'); $(this)[0].reset(); grecaptcha.reset(); }"

2/ Go to the backend and edit CMS page where you put formbuilder component. Click on the puzzle and add custom redirect as: #contact (adjust anchor tag for your project).

If you need more assistance please write me private message.

Last updated

1-9 of 9

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.