Eagletrophy Eagletrophy - 5 months ago 7
jQuery Question

Submitting form with links and jQuery

Submitting a form using a link powered by jQuery is what I am curious about. Do I just bind a click event to the link in the live() event for eg and use a submit() added to the click?


Ok, I believe this answer's your question. Also, included one with support for validation, cause most form data needs to be validated. Hope this answers your question.

// Not Validation
$("#btnSubmit").click(function() {

// With Validation
$("#btnSubmit").click(function() {
    // Will only submit it validate() returns true
    if( validate() ) $("#frmToSubmit").submit();