It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum

How to select link in code

How to select link in code

Postby AnnaW on Tue Nov 09, 2010 9:33 am

Hi all,
I have a contact form at the bottom of my webpage. When the user submits the form, the page is reloaded and the user moved back to the top of the webpage. I want focus to be returned to the contact form.

Therefore I have created an anchor point within the contact form:-

<a name="anchor"></a>

How do I get the anchor point linked to within HTML or PHP?

Thanks guys.
AnnaW
 
Posts: 1
Joined: Tue Nov 09, 2010 9:19 am

Re: How to select link in code

Postby HotNoob on Tue Nov 09, 2010 5:23 pm

you do it with the url
for example:
index.php#IdName

Code: Select all
<div id=anchor style="position:absolute;top: 100px;">
</div>


so you put that on your page, and i made it an absolute element to make it easier to adjust where you want it to scroll to, so you just change the top property in the style.

in this case you'd do something a long the lines of
index.php#anchor
---
if your fine with the default location of where it goes to, just remove the top property.
HotNoob
100+ Club
 
Posts: 169
Joined: Sun May 02, 2010 1:38 am


Who is online

Users browsing this forum: No registered users and 7 guests