Jump to content
Sign in to follow this  
thomasbubi

FormBuilder: How to embed form as an iframe?

Recommended Posts

Hello,
I did some performance optimizations on our website and i discovered a bottleneck which originates from how a form build with FormBuilder is embedded into the site.
We have a navigation bar on the website. Inside the bar, there is a option to open the contact form, which is then opened as an overlay over the current page. To achieve this, the form is rendered in ProcessWire's _init.php and then inserted under the <main> tag. This happens on every page the user views and unfortunately FormBuilder seems to have ugly dependencies like jQuery 1.11.1 which is inserted into the <head> of the document, which has negative effects on performance.
I like the idea of openening the form in an overlay, but I would like to change the code so the form is only rendered when the user clicks on "Contact" in the navigation bar, maybe using an iframe. How would I do this?

Thanks a lot!

Share this post


Link to post
Share on other sites

You can embed a form in an iframe using: 

$forms->embed('form-name');

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...