Srivathsan
Srivathsan

Reputation: 630

Redirecting pages with the header thing

I know how to redirect a page using the header thing. The problem is that when I redirect using this header it scrolls the page to the top. Let me clear it now.

I have a form on a page which has an action to sample.php. The sample.php redirects to the same page where the form was. But it takes the page to the top. I mean it scrolls to the top. I need it to be in the same place where the scroll button was earlier before redirecting. Is it possible to do this thing. Please help me out.

Upvotes: 0

Views: 58

Answers (2)

Niet the Dark Absol
Niet the Dark Absol

Reputation: 324650

Possible, through use of JavaScript, but it would be easier to define an anchor and point the form there. For instance, <form action="sample.php#scrollhere" method="post" id="scrollhere">.

Upvotes: 2

Anne
Anne

Reputation: 27073

In order to scroll to <div id="here"> or <form id="here"> on sample.php redirect to:

http://www.website.com/sample.php#here

Upvotes: 0

Related Questions