How to submit form and scroll to anchor

Posted on 2011-04-28
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:
Question by:ncw
    LVL 27

    Accepted Solution

    1. Try to use a name without a number OR with a name starting with a letter
    2. use jQuery
    LVL 9

    Expert Comment

    LVL 107

    Expert Comment

    by:Ray Paseur
    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:

    LVL 1

    Author Comment

    @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:

    LVL 1

    Author Closing Comment


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit ( and similar technologies have enjoyed wide adoption, making it possib…
    Article by: DanRollins
    This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (, we'll extend the program by adding a depth-…
    The viewer will learn how to count occurrences of each item in an array.
    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.

    728 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now