Embed form inside iframe externally
Support › MB Frontend Submission › Embed form inside iframe externallyResolved
- This topic has 6 replies, 2 voices, and was last updated 3 years, 1 month ago by
Nicholas Cox.
-
AuthorPosts
-
June 9, 2022 at 11:57 PM #36401
Nicholas Cox
ParticipantHi
I was wondering, is it possible to embed a front end form inside a iframe? so i can display the form on a subdomain oage? or will i need to create this functionality myself? i basically want to output the form externally but on the same domain name.
thanks
June 10, 2022 at 12:21 PM #36420Long Nguyen
ModeratorHi Nick,
Yes, it is possible to embed a frontend form in an iframe tag. You can also refer to this documentation for more information https://docs.metabox.io/extensions/mb-frontend-submission/#embedding-forms-on-other-sites-via-iframe
June 10, 2022 at 2:46 PM #36426Nicholas Cox
ParticipantOk thanks. There is no example of the iframe element so i assume that the form has to be outputted on a webpage and embed the whole webpage inside the iframe?
Is there a way just to output the form only inside a iframe with required css/js?
Thanks
June 11, 2022 at 2:40 AM #36442Long Nguyen
ModeratorHi,
iframetag is used to embed the HTML document to display the content on a page. I do not see a way to embed a shortcode only with this tag. Or you can try to create a blank page with the frontend form only.Please read more on the documentation https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
June 11, 2022 at 5:09 AM #36447Nicholas Cox
ParticipantHi
sorry i think i did not explain myself clearly. I do not understand this guide https://docs.metabox.io/extensions/mb-frontend-submission/#embedding-forms-on-other-sites-via-iframe as i thought there would be an example of a iframe tag pointing to a page with an embedded form?
I thought about creating a blank page with the front end form, but if i try to include the shortcode in a php file it renders the form but with no js/css.
e.g.require_once( '../../../../../../wp-load.php' ); echo do_shortcode('[mb_frontend_form id="dc-product-comments" submit_button="Submit" ajax="true"]');Or event if I create a hidden wordpress page and include the front end form shortcode then i end up outputting header/footer content too, which i do not want.
June 14, 2022 at 10:59 AM #36471Long Nguyen
ModeratorHi,
Most scripts (CSS, JS) in a theme or a plugin are registered by the function wp_enqueue_script() and they are loaded in the header or footer of the page. So if you remove the header or footer, the script files could not be loaded.
I think you can try to use the CSS code to hide the header and footer instead of excluding them from loading.September 9, 2022 at 5:55 AM #38239Nicholas Cox
Participantok thanks, i have managed to sort it out with CSS to hide it.
-
AuthorPosts
- You must be logged in to reply to this topic.