/    Sign up×
Community /Pin to ProfileBookmark

How do I get a "Submit" to link to an anchor?

Hi,

I was just wondering how I would go about linking a form “Submit” button to a page anchor?

For example I have this HTML code:

<a name=”backhere”></a>

on a certain part of the page that I want to be at the top of the screen when I click on the “Submit” button.

Is this the correct code that I should put on the submit button or not:

<FORM ACTION=”/html/contact_us.html?send=now” METHOD=”POST” A REF=”#backhere”>

So far it doesn’t work and I don’t know why. If somebody could help me out with this then that will be FANTASTIC!!!!

Kind Regards,

Dan ?

to post a comment
HTML

5 Comments(s)

Copy linkTweet thisAlerts:
@NogDogOct 01.2004 — This might work (haven't tried it):
&lt;FORM ACTION="/html/contact_us.html#backhere?send=now" METHOD="POST"&gt;
Copy linkTweet thisAlerts:
@Paul_JrOct 01.2004 — [font=palatino linotype]/html/contact_us.html?send=now#backhere[/font]
Copy linkTweet thisAlerts:
@blastbumauthorOct 02.2004 — Thanks Paul Jr!! You're a champ!

Only thing is, the page jerks when you click on "Submit" (the page goes up and back down really quickly). I was just thinking whether there was a possibility of some sort of script that kept the page down the bottom the whole time (no twitches or glitches) without it being linked to an anchor.

Could this be a possibility?

Thank you once again.

Dan
Copy linkTweet thisAlerts:
@Paul_JrOct 02.2004 — [font=palatino linotype]I don&#8217;t believe there is any way of getting by that. The form is on the same page as the form&#8217;s action attribute, right? The page jerks when you hit the submit button because the page has to fully render before it can be scrolled to the anchor. So in the time it takes for the page to load, the top of the page will be in view.[/font]
Copy linkTweet thisAlerts:
@David_HarrisonOct 02.2004 — [i]Originally posted by blastbum [/i]

[B]For example I have this HTML code:



<a name="backhere"></a>[/B]
[/QUOTE]
You don't need code like that. If you want to create an anchor now you just have to apply id="backhere" to something.

For example:&lt;h1 id="blahblah"&gt;This is a header!&lt;/h1&gt;

&lt;p&gt;
Here is some text.
&lt;/p&gt;

&lt;a href="#blahblah"&gt;Here is a link back to the header.&lt;/a&gt;
Of course, you're submitting a form which has the #blahblah already appended to the URL rather than using a link to go to the anchor, however the principle is the same.

Check out [url=http://www.quiterude.com/]my site[/url], on the comment pages there are links to anchors all over the place however you'll not find a single <a name="something"></a> anywhere.
×

Success!

Help @blastbum spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...