Skip to content

Instantly share code, notes, and snippets.

@wholypantalones
Created July 10, 2012 14:02
Show Gist options
  • Select an option

  • Save wholypantalones/3083409 to your computer and use it in GitHub Desktop.

Select an option

Save wholypantalones/3083409 to your computer and use it in GitHub Desktop.
Submit A Form With A Link
<a href="javascript:{}" onclick="document.getElementById('theFormName').submit();">submit</a>
or
<a href="#" onclick="return doMyBidding();">submit</a>
function doMyBidding() {
var answer = confirm("Are you sure you want to do my bidding?");
if (answer){
document.getElementById('theFormName').submit();
}
}
or
$("#thisahref").click(function() {
$("#theform").submit();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment