Resize iframe on form submit
See original GitHub issueHi
Great code! I got my iframe to resize after hours of trying different things. But I have a problem. I got this form on inside the iframe.
<form class="search" action="http://sinsio.dk/search.php" method="get">
<input name="s" id="s" type="text" value="" placeholder="Søg i over 200.000 produkter" /> <input type="submit" value="Søg" />
<input type="hidden" name="post_type" value="product" />
</form>
This changes the content of the iframe to my seach result but the iframe does not resize on this page. Is it possible to resize the search.php page? The file is on the same domain as the original iframe source.
I tried to copy the javascript code from my original iframe but that does not work.
<script>
var iFrameResizer = {
messageCallback: function(message){
alert(message,parentIFrame.getId());
}
}
</script>
<script type="text/javascript" src="https://sinsio.dk/iframe-resizer-master/js/iframeResizer.contentWindow.min.js" defer></script>
<script>
parentIFrame.size();
</script>
The iframe on the search result page is the same as the height of the iframe before the search.
Any ideas how to solve this?
Kind regards, Michael
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Resizing the iframe after form submit doesn't work
I have the following html file. I have a form which upon submit should call the foo() function. The foo() function should make...
Read more >Embedded Google Forms: how resize the height of the iframe ...
How to resize the height of the iframe after a submit ... In this short article we are going to show a simple...
Read more >Resize an iframe based on the content - GeeksforGeeks
The iframe HTML element is often used to insert contents from another source. Contents which needs resizing is done indirectly using a div...
Read more >Embedded forms do not resize the iFrame code properly and ...
I have checked your forms and submitted a few form submissions from different browsers to encounter the issue but I am not able...
Read more >Auto-resize Iframe when Content Size Changes - WillMaster
An iframe is a section of a web page where the content of another web page can be published. It's done with an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That also worked for me! Thanks for sharing the solution 😃
our Problem is solved by changing the Parameter checkOrigin to false, because we link to another URL in the iframe.