Posted By

vagrantradio on 08/27/11


Tagged

submit


Versions (?)

Submit Form with Link


 / Published in: JavaScript
 

Trivial, but meh.

  1. <a href="javascript:{}" onclick="document.getElementById('theFormName').submit();">submit</a>
  2.  
  3. or
  4.  
  5. <a href="#" onclick="return doMyBidding();">submit</a>
  6.  
  7. <script>
  8. function doMyBidding() {
  9. var answer = confirm("Are you sure you want to do my bidding?");
  10. if (answer){
  11. document.getElementById('theFormName').submit();
  12. }
  13. }
  14. </script>

Report this snippet  

You need to login to post a comment.