Forum Moderators: open

Message Too Old, No Replies

adding an anchor to a GET form's action

Is it possible?

         

tata668

7:25 pm on Nov 8, 2005 (gmt 0)

10+ Year Member



I'd like a GET form to generate an URL with an anchor... Is it possible?

Ex, I'd like the generated URL to be:

"currentPage.php?test=123#myAnchor"

This doesn't work:


<form method="get">
<input type="text" name="test" value="123" />
<input type="hidden" name="#" value="myAnchor" />
</form>

Any idea to add an anchor? Is it possible?

Robin_reala

8:57 pm on Nov 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your form with have an action attribute to submit to right? Try adding an anchor fragment to the end of it. For example:

<form method="get" action="currentpage.php#myAnchor">

tata668

9:17 pm on Nov 8, 2005 (gmt 0)

10+ Year Member



When my page submits to itself I usually don't put an action to my forms... But simply adding action="#myAnchor" works!

Thanks!

Robin_reala

7:50 am on Nov 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Cool - didn't know that worked.