View Full Version : forms and page anchors : possible?
I'm working on a form that's located at the bottom of a page and have used an HTML anchor (<a name = "contact">) to "bounce" the visitor down to where that form is located. But, after the user makes their entries and clicks the 'SEND' button I want to send them BACK down to that very same area for results... but I can't because the pound/number sign which serves as the anchor does not survive the reload of the page. In the URL it comes back as a %23 instead of as # and that just doesn't seem to work. I know that this is correct behavior for a browser but is there any way to get this to work? If so, what am I missing?
I await someone's perspicacity.
echo "<input type=\"hidden\" name=\"foo\" value=\"bar#contact\">";
<!--All that HTML goodness-->
From what I understand, that's all you need, unless you're using XMLHTTPRequest, or a redirect.
If you're using a redirect, just point it to that URL.
I couldn't get this part
to work right, hence I switched to the attempt shown in my first post of this thread. Now I'm just splitting the info up and it works right!
Now I just toss in a hidden field to send the "section" variable
echo "<input type=\"hidden\" name=\"sec\" value=\"about\">";
and it all works great!
EDIT: Yes, I'm working in PHP.
The only reason I could see that it might be doing that, would be if you're doing a html_entities call on the Output buffer...
Just, if you wanted to know a possible cause.
vBulletin® v3.6.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.