0

I have a form that, when submitted, will redirect the user to a form accepted page. The redirection works fine, but because this content is sitting in an iframe, the form accepted page is of a shorter height than where the submit button for the form is. Basically a user submits the form but when it redirects they have to scroll up to see the redirected page content. All of this is handled with jQuery.

What are some options available to me? Can I reset the iframe height after a submit? Can I somehow tell the browser to return to the top of the page? I know AJAX is pretty powerful with this sort of content but I have never used it before.

Shaazaam
  • 102
  • 1
  • 11
  • can you post a code as example what you tried ? – Azeem Hassni Aug 13 '14 at 14:12
  • Yes, You can resize the iframe using jQuery. See here http://stackoverflow.com/questions/12872394/resize-iframe-to-content-with-jquery – Sam Aug 13 '14 at 14:17
  • Perhaps in the callback of the submuit button click function, you can place a $('html, body).scrollTop(); call to have it move back up the page. – BReal14 Aug 13 '14 at 14:24
  • I have tried these two functions: `$('#Submit').click(function() { $('#rmaframe',window.parent.document).css('height','500px'); });` `$('#rma').click(function() { //#rma is the id of my form $('#rmaframe',window.parent.document).css('height','500px'); });` – Shaazaam Aug 13 '14 at 14:27
  • I used `$(window.parent.document).scrollTop(0);` on the form accepted page and it worked. Thank you. – Shaazaam Aug 13 '14 at 14:40

0 Answers0