0

On my website there is a contactform on the bottom of the page. When it is filled in and a user pressed the submitbutton, the page reloads but shows the top of the page. What do I need to adjust so when a user pushed the submitbutton, the page reloads and goes to the bottom of the page?

Thanks!

STheFox
  • 1,478
  • 4
  • 18
  • 24
  • what about having some sort of "Thank you for contacting me" page, instead of reloading the same page? I think it's less likely to confuse users. – andi Oct 23 '13 at 17:58

2 Answers2

2

You have a few options:

  1. Set the hashtag
  2. You can use jQuery and use .scrollTop()
  3. Or native with window.scrollBy(0,9999);
  4. Submit the for through Ajax so you don't have to refresh the page.
Community
  • 1
  • 1
Niels
  • 48,601
  • 4
  • 62
  • 81
1

Put a named anchor to where you want to go after form sending:

<a name="afterform"><h1>Example: a heading</h1></a>

And then add that as a hash to the form action:

<form action="yourpage.html#afterform" ...
PurkkaKoodari
  • 6,703
  • 6
  • 37
  • 58