submit a form with an anchor tag (link)


/ Published in: JavaScript
Save to your folder(s)

Name the form what ever you like, but make sure that is reflected in the javascript.


Copy this code and paste it in your HTML
  1. <form id="my_form">
  2. <!-- More HTML -->
  3. <a href="javascript:{}" onclick="document.getElementById('the_form').submit(); return false;">submit</a>
  4. </form>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.