How to submit form and scroll to anchor

Using anchor points within a page should be easy, but I want to submit a form and then scroll to an anchor point and it's not working. I've added <a name="1"></a> and the form url is submitting to a php file with parameters:
product_info.php?products_id=1&action=add_product#1"
LVL 1
ncwAsked:
Who is Participating?
 
Lukasz ChmielewskiCommented:
1. Try to use a name without a number OR with a name starting with a letter
2. use jQuery
http://plugins.jquery.com/project/ScrollTo
0
 
cb1393Commented:
0
 
Ray PaseurCommented:
You might find a solution in JavaScript, but I think you won't find it in the HTTP protocol.  If you do, I think you would need the link to say something like this:

product_info.php#1?products_id=1&action=add_product
0
 
ncwAuthor Commented:
@cb1393: The discussion on that link had no relevance.

@Ray: url format looked promising but unfortunately didn't work, I think you are right it has to be js.

@Roads: It didn't work with a name instead of a number either. I'm sure the jquery plugin would work however I prefer not to load a whole library of code for something that can be achieved with simple javascript, so I'm going to try this:
http://clifgriffin.com/2008/10/14/using-javascript-to-scroll-to-a-specific-elementobject/

0
 
ncwAuthor Commented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.