Modals

RSform Jquery error when loading in modal

4 months 1 day ago #78222

Simon Logan's Avatar Simon Logan

HI Peter

I'm trying to embed an RSForm Pro form into an article which is in turn being loaded via a modal link.

The article loads okay but the form triggers a Jquery error "RSForm Pro is not defined". I' ve tried using both the RsForm system and content plugins, also tried reordering the system plugins but no joy. I also checked that the form is embedded properly when I view the article not in a modal and it does. I also tried using a module to embed it (RSForm Pro Module) in the article but again no joy.

Any ideas what I can try?

4 months 1 day ago #78224

Peter van Westen's Avatar Peter van Westen Admin

Try switching on the 'Load scripts/styles' option in the Modals system plugin settings.

If that does't work, try opening the modal in iframe mode:

{modal url="your/url" iframe="true"}
Or switch on the option in Modals plugin settings to open links in iframe mode by default.

If you lose the templates styling when opening the modal via the iframe mode, see:
www.regularlabs.com/extensions/modals#th...-the-correct-styling

4 months 1 day ago #78225

Simon Logan's Avatar Simon Logan

Thanks, the iFrame option was the only one which worked and I've created a "modal.php" file in the template dir to fix the styling, g.appreciated

4 months 1 day ago #78226

Simon Logan's Avatar Simon Logan

Sorry one more thing, the form redirects to a page on the site with thank you text, at the moment that page is opening within the modal itself, is there any way to force the modal to close once the form has been submitted and the redirection page open in the normal window?

4 months 1 day ago #78227

Peter van Westen's Avatar Peter van Westen Admin

You need to make sure the form gets a target="_top" or target="_parent" attribute.

4 months 1 day ago #78237

Simon Logan's Avatar Simon Logan

Didn't think that was working at first then realised I needed to put in "_parent" instead of just "parent".

Thanks, that's better now!

4 months 19 hours ago #78241

Peter van Westen's Avatar Peter van Westen Admin

Oops, sorry.