submitting form-payment

User 486377 Photo


Registered User
4 posts

hi, I have a form that links to paypal and when the submit button is selected the form condenses, listing the total and the button to pay with paypal. The problem I am having is that the form is longer and when the submit button is selected and the form condenses the page does not scroll to the top, on IE, firefox, the page is just blank and then site visitor would have to scroll to the top to checkout. Is there a way to have the form auto scroll to the top so that the condensed form is seen immediately? Thanks.
User 2147626 Photo


Ambassador
2,958 posts

I'm shooting in the dark here because I don't have time to test this tonight. But if I remember correctly, and I may not, Eric came up with a simple solution to a problem very similar to this. All I can say is try it, and if it doesn't work, well, you'll have to wait for Eric to pop in (he's rather good at that!) :D

Add this to the top of the page containing the iframe with your form code...
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script language="javascript">
jQuery(document).ready(function() {
$('body iframe').load(function(){
$(window).scrollTop(0);
});
});
</script>

Let us know if it works...
Graphics for the web, email, blogs and more!
-------------------------------------
https://sadduck.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.