How do I use buttons to link to anchor tags on my form?

  • Profile Image
    Asked on February 24, 2013 at 09:28 AM

    I'm trying to use HTML to create a standard button (think <input type="button">) that will allow users to click the button to jump to another area of the form, but I cannot seem to get the code to function properly.


    I've created two buttons on my Online Service Request (Pet Sitting and Dog Walking) and two corresponding anchors within the page to take the user to the desired section of the form.  However, when I click on either button, nothing happens.


    Can you help me?  I want to eliminate the page breaks I have been using on this lengthy form and anchors seemed the perfect solution .. until I tired to implement them...



  • Profile Image
    Answered on February 24, 2013 at 10:34 AM

    You will need to put an event function to make your input type work e.g.

    <input type="button" onclick="window.location=''">

    However to transfer data to another page will require you PHP knowledge as using input type button to go to another page will not send the data from the previous page form.

    Alternatively, the most convienient you can do is by using a dropdown or radio button and set the conditional logic to view the selected choice.

    Another way is by creating two(2) submit button and set the custom url to the next form. However, by doing this, you will receive two submission instead of one.

    Lastly, you can download the form source code and create the PHP function that will handle the data.

    If  you need futher assistance let us now.

  • Profile Image
    Answered on February 24, 2013 at 11:00 AM

    All I need to do is make the buttons link to an anchor tag within the same form, same page.

    This is the code I have, using the information you provided:

    <table border="0" cellspacing="0" cellpadding="0" width="80%">



    <td width="40%" align="left"><input onclick="window.location='#sitting'" type="button" value="Pet Sitting" /></td>

    <td width="40%" align="right"><input onclick="window.location='#walking'" type="button" value="Mid-Day Walking" /></td>




    Nothing happens when either button is clicked.

    Any thoughts?

  • Profile Image
    Answered on February 24, 2013 at 12:48 PM

    I have created an alternative method that works minus the buttons you added which I replaced with links. I cloned your form and changed the link references for the coding in the html so that it would go to the specified section of your form.

    You can see the demo version in action here and you will notice that the form links work and take you to the anchored section of your page now.

    Please let me know if this will work for you or not and feel free to clone it back if it meets your needs.

  • Profile Image
    Answered on March 16, 2016 at 09:06 PM

    I tried your system Kade, and it worked fine when I opened the form directly on the browser, but when I embed it into a page, it didn't work. Is there any way around this?
  • Profile Image
    Answered on March 16, 2016 at 10:46 PM

    This is an old thread. To better assist you, I have moved your concern to a new thread which you can see by following this link: