Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to submit form and scroll to anchor

Posted on 2011-04-28
5
Medium Priority
?
759 Views
Last Modified: 2012-05-11
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"
0
Comment
Question by:ncw
5 Comments
 
LVL 27

Accepted Solution

by:
Lukasz Chmielewski earned 2000 total points
ID: 35484391
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
 
LVL 9

Expert Comment

by:cb1393
ID: 35484415
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 35486155
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
 
LVL 1

Author Comment

by:ncw
ID: 35489858
@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
 
LVL 1

Author Closing Comment

by:ncw
ID: 35490232
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question