Jump to content

Help with html name anchor


Riparian

Recommended Posts

Is there a way the trigger a html name anchor as a result of a search ?

 

Explanation : A page of names and details with say 50 entries. I would like a quick name search at the top that jumps to a named anchor that I have set up during the while loop.

 

I currently have this working by displaying a hyperlink  after the search has found the name but I have to click the hyperlink... 2 actions for the same process and 3 refreshes of the screen :(

 

Any help is greatly appreciated

 

Thanks heaps

Brian

Link to comment
https://forums.phpfreaks.com/topic/90831-help-with-html-name-anchor/
Share on other sites

I don't quite understand. I hope this helps. Someone simply enters the name of the anchor into the text field and it searches for that anchor and brings you to the name of that anchor.

<script>
function search_anchor(object)
{
_anchor = object.value;
parent.location = '#' +  _anchor;
}
</script>

<input id="search" type="text" name="search" />
<input type="button" value="Search" onClick="search_anchor(search)"/>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.