Eagletrophy Eagletrophy - 2 years ago 78
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?

Answer Source

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();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download