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