I'm editing some existing html where the javascript loads a another page inside an iframe. In the page is an html form. When I hit submit, I'd like for the outer page to stay and the iframe to change to the results page. However, right now the whole page changes to the results page for the form. I'm guessing there's a way to solve this javascript. Any suggestions?
To embed your form using an iFrame, copy and paste the iFrame code directly into the HTML of your web page.
If you want to display specific area of external website using iframe, then you will learn in this article how to embed a specific part of a web page using css. Suppose, you want to show only one div element from another website and want to hide some specific content, then you can easily do this using <iframe> tag.
An iframe has another scope, so you can't access it to style or to change its content with javascript. It's basically "another page". The only thing you can do is to edit its own CSS, because with your global CSS you can't do anything.
You will need Formfacade, an add-on for Google Forms, to achieve that. Similar to the Embed HTML option, Formfacade will give you an embed code, which will allow you to render your form without iframe and without Google Form branding.
Target the form to the iframe:
<iframe name="foo"></iframe>
<form target="foo"></form>
Try using the target
attribute of the form tag. You can specify the frame.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With