i have an iframe with code [iframe src="http://projects.qbf.ie/smartquotes/wp-content/themes/smartquotes/form/mortgage.php" width="100%" height="1600px" onload="window.parent.scrollTo(0,0)"] after submitting the form i result is in middle of the page. I tried many javascripts codes but its not working. here is the form website http://projects.qbf.ie/smartquotes/mortgage-life-insurance/ can somebody help me ?
the iframe is in wordpress page and calling morgages.php where is quotes.js in head. what you mean add in quotes.js ?
Right. I see your quotes.js in here: http://projects.qbf.ie/smartquotes/wp-content/themes/smartquotes/form/quotes.js Now as part of that quotes.js, these lines below will do something when someone submits the form, right? $('form').submit(function() { $(this).fadeOut(250).before('<div style="text-align: center; font-size: 32px;"><img src="loader2.gif" alt="loading" /><br />Loading...</div>'); }); Code (JavaScript): So if you can add some lines to it to also scroll parent window after a submission... that should be a solution to your question? Hendra
i tried already some jquery there like: and nothing is working. can you help me please ? thanks $('form').submit(function() { $(this).fadeOut(250).before('<div style="text-align: center; font-size: 32px;"><img src="loader2.gif" alt="loading" /><br />Loading...</div>'); $('#myiframe').contents().scrollTop(0);
Try something like below, $('form').submit(function() { $(this).fadeOut(250).before('<div style="text-align: center; font-size: 32px;"><img src="loader2.gif" alt="loading" /><br />Loading...</div>'); window.parent.scrollTo(0,0); }); Code (JavaScript):