Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically scroll down after submit action

How to make my website automatically scroll down after sending e-mail from "Contact Form" which is located on the bottom of my webpage? Information about successful sending or error ouccurs below the form and after clicking that 'submit' button page is refreshing and user can see only top of the site, not the bottom...

like image 974
Tony Avatar asked Feb 25 '14 21:02

Tony


People also ask

How do I make my page automatically scroll down?

To use you just need to press CTRL+ Left click of your mouse and drag the mouse a bit in the direction you want to scroll the page. For example, if you want to scroll up to the page automatically, click CTRL+ left click and slightly move your mouse upwards, the tool will start scrolling up the page.

How do I make my keyboard scroll automatically?

This can be done by holding and scrolling until released, or by short clicking and scrolling until clicking once more (any mouse button) or pressing the Esc key.

How do I make Div scroll automatically?

Set the overflow-x:hidden; and overflow-y:auto; that will automatically hide the horizontal scroll bar and present only vertical scrollbar. Here the scroll div will be vertically scrollable.

How do I automatically scroll down a page in HTML?

The first one is with javascript: set the scrollTop property of the scrollable element (e.g. document. body. scrollTop = 1000; ). The second is setting the link to point to a specific id in the page e.g.


1 Answers

<form id="form" action="{your_action}#form">
....
</form>

or if you want scroll to alert position :

<div id="form">
  <div class="alert">Alert</div>
  <form action="{your_action}#form">
  ...
  </form>
</div>
like image 62
DJafari Avatar answered Sep 21 '22 03:09

DJafari