Need something like a "back to top"...

User 1953598 Photo


Registered User
12 posts

I have a long form (1400 px) using payment buttons. After you click the submit button, you only see the (now) blank bottom of the form. You have to scroll back to the top to see the PayPal buttons. I'm wondering if I can put some code that takes the user to an anchor tag at the top of the form? Here's the form page: http://enchantedlens.org/lepp
User 1953598 Photo


Registered User
12 posts

Well, after much Googling, I found my answer—Javascript. In the html page that WFB makes, find the <body> tag. Change it to
<body onSubmit="window.parent.scroll(0,0);">
After the user clicks the "Submit" button, when the page reloads, the page will be back at the very top. Since I have a bunch of text above the form window and I want the user to see the top of the form, I found that changing the second value to 800 works well —
<body onSubmit="window.parent.scroll(0,800);">
The 800 means that when the page reloads, it's as if the page was scrolled 800px down.
User 184085 Photo


Ambassador
1,707 posts

excellent find ;)
Volunteering to help :)
http://www.tbaygeek.ca
My HTML play area
http://www.tbaygeek.ca/test/
User 2268225 Photo


Registered User
2 posts

Darrel Patterson wrote:
Well, after much Googling, I found my answer—Javascript. In the html page that WFB makes, find the <body> tag. Change it to
<body onSubmit="window.parent.scroll(0,0);">
After the user clicks the "Submit" button, when the page reloads, the page will be back at the very top. Since I have a bunch of text above the form window and I want the user to see the top of the form, I found that changing the second value to 800 works well —
<body onSubmit="window.parent.scroll(0,800);">
The 800 means that when the page reloads, it's as if the page was scrolled 800px down.
User 2268225 Photo


Registered User
2 posts

Where do I place this code at, do I place it in the html that WFB generates?
User 187934 Photo


Senior Advisor
20,188 posts
Online Now

Alter the <body> tag of the myformname.html
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 400784 Photo


Registered User
14 posts

Eric Rohloff wrote:
Alter the <body> tag of the myformname.html

I also need to alter this code but I can't find the above file? Can you be more specific on where it is saved!

Another problem I have (and I haven't completed the form yet) is that the bottom of the form is starting to dissappear off the bottom of the page. The user cannot scroll down and the only way to access this area of the form is to tab from box to box but the user won't know that.

Also, my placeholders works on preview but not when uploaded (see link). I would like to fix this too!

I have looked but can't find any solutions (apart from this one) on these teething problems.

This is the link to my form:
http://canine-shop.co.uk/Raw%20Shop/Order_Form.php
User 132002 Photo


Registered User
131 posts

Find this code in your html file:
<span><script type="text/javascript">document.write(unescape("%3Ciframe id=\"fb_iframe\" src=\"http://www.canine-shop.co.uk/Raw Shop/RAW%2520ORDER%2520FORM.php" + window.location.search + "\" width=\"794\" height=\"1896\"allowtransparency=\"true\" scrolling=\"no\" frameborder=\"0\"%3E&lt;a href=\"http://www.canine-shop.co.uk/Raw Shop/RAW%2520ORDER%2520FORM.php\" title=\"RAW%2520ORDER%2520FORM\"&gt;Check out my CoffeeCup Form&lt;/a&gt;%3C/iframe%3E"));</script><iframe id="fb_iframe" src="http://www.canine-shop.co.uk/Raw Shop/RAW%20ORDER%20FORM.php" allowtransparency="true" frameborder="0" height="1896" scrolling="no" width="794">&lt;a href="http://www.canine-shop.co.uk/Raw Shop/RAW%20ORDER%20FORM.php" title="RAW%20ORDER%20FORM"&gt;Check out my CoffeeCup Form&lt;/a&gt;</iframe><br><br><br><noscript> <iframe width="794" height="1896" style="border:none; background:transparent; overflow:hidden;" id="fb_iframe" src="http://www.canine-shop.co.uk/Raw Shop/RAW%20ORDER%20FORM/RAW%20ORDER%20FORM.html"> &lt;a href="http://www.canine-shop.co.uk/Raw Shop/RAW%20ORDER%20FORM.php" title="RAW%20ORDER%20FORM"&gt;Check out my CoffeeCup Form&lt;/a&gt; </iframe></noscript></span>

Look for height="1896"
Change that hight to something greater than 1896.
It should bee changed in 3 places.
Remember to leave space for error messages.

Søren
Søren, Denmark
User 187934 Photo


Senior Advisor
20,188 posts
Online Now

Go to this directory and open the myformname.html. Now replace the code of the body tag near the top.:)
myformname_exported/myformname/myformname.html
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 400784 Photo


Registered User
14 posts

Eric Rohloff wrote:
Go to this directory and open the myformname.html. Now replace the code of the body tag near the top.:)
myformname_exported/myformname/myformname.html


Thank you Eric - found the file and entered this code as instructed (<body onSubmit="window.parent.scroll(0,0);">) and this is what has happened...

Select and complete the form from this location http://canine-shop.co.uk/Raw%20Shop/category.php and the form will return to top of page on submission but...

Select and complete the form within the shop http://canine-shop.co.uk/Raw%20Shop/Order_Form.php and it doesn't work!

Any ideas why? :/

This is intresting; I have also just noticed that the placeholders are visible in the former url but not in the latter!

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.