Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Anchor nto working

Status
Not open for further replies.

developer155

Programmer
Jan 21, 2004
512
US
Hi I place an anchor on a form like this
<a name="formstart"></a>

and then at the bottom I have a link to the anchor like this
<a href=\"#formstart\" onClick='DoSomething()'>Edit</a>

the Edit link is supposed to jump user to top of the form and execute a JS function
The issue is it does not jump to the position of the anchor unless I do this to the anchor, place an acual wording. But I do not want the anchor to say anything
<a name="formstart">HERE</a>

Dont anchors work without the actual wording?

thanks!
 
Actually the anchor needs to be inside the form, amonth tr elements, because the form has a lot of stuff before the anchor and I dont want to jump there
The anchor is embedded in a table which is ebmedded in a td of a form tr.
<a id="formstart" /> no luck
 
Then link the anchor to the specific element you are interested in.

For example, if it's an input element...

Code:
<input id="targetelement" name="thingy" type="text" value="" />

Then make your link like
Code:
<a href="#targetelement">Jump there</a>

<honk>*:O)</honk>

Earl & Thompson Marketing - Marketing Agency Services in Gloucestershire
 
Hmm, I will try, the only thing is ID's on the form are generated dynamically...

is there something wrong with <a name="formstart /> anchor?
There is a reason why it is not working?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top