use link as submit button

Posted on 2011-05-11
Last Modified: 2012-08-13

Does anyone know if I can use a normal href hyperlink to submit a form. I've looked around at the forum, and I can't seem to see a simple answer...or anyone who has asked the question without also needing to do something else complex. I just need to have the form submit some data to a php process page. But I do not want a button. Just a link!

Thank you in advance!
Question by:hibbsusan
    LVL 7

    Accepted Solution


    You can tie a link into javascript like this...

    <a href="javascript:submitform()">your link</a>
    LVL 7

    Expert Comment

    The link provided shows how to submit a form with javascript.
    LVL 23

    Expert Comment


    <form action="">
      <a href="javascript:document.forms[0].submit()"> submit Form</a>

    Open in new window

    LVL 13

    Expert Comment

    may be u can do like this.

    <form name="test">
    <a href="#" onclick="javascript:return doSubmit()">Submit Form</a>
    <script type="text/javascript">
       fucntion doSubmit(){
            //do validations if needed.
            return true;

    Author Closing Comment

    Really quick answer. It couldn't have worked more perfectly.

    Thank you so much!

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
    Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
    In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    745 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

    16 Experts available now in Live!

    Get 1:1 Help Now