Modal & Form pro

I use a partial and within it I have a modal and in the modal I use the form pro stack. After submitting the form on the testwebsite the page reacts in a unusual way. I can’t submit another form e.g. the modal doesn’t open up and in some cases the page won’t load entirely. What I see happening in the address bar (chrome as a browser in this case)is the following behaviour: before submitting the address bar is: http://broer.us/godk/Vrijwilliger/, after pressing the modal button the address stays the same yet after submitting the form the address bar changes to http://broer.us/godk/Vrijwilliger/#Contactformulier .

Probably I’m overseeing some setting yet after trying a lot I have no clue how to solve this.

Thanks in advance for your advice,

DJ

Hi there @djb902, hope your weekend if going well so far!

This second URL is the form’s POST action URL. This is the URL the form returns to after the forms data has been submitted. The #Contactformulier is the form’s anchor link. When using the form on a page – not in a modal – the page would jump to the form’s location after the page reloads. Since your form is in a modal this is not a possibility.

Honestly – While you can technically put a form in a modal like this, I personally wouldn’t do so unless it was either a hand coded form that was meant to be in a modal, or it was a stack specially designed around the premise of a form in a modal. You’re putting two things together that could work in this way, but with caveats because they weren’t specifically designed for this task. Secondly – since the form is in the modal your visitor can’t see if the form submission was successful or not. I would personally not put a form in a modal like that unless it were an AJAX-based form, which the Form and Form Pro stacks are not AJAX-based.

TL;DR – IMHO I would not put a form in a modal, both for technical reasons and for usability reasons.

1 Like

Thanks, wanted to go to the edges of functionality. Solved everything now with a different approach (not as nice as with a modal but… it works :-). Perhaps a nice feature when you upgrade one of the addon packs…

The form would still work the same way even if I update the addon packs. Their functionality and the way they have to work would remain the same as they’re not AJAX based forms.

1 Like