tags:

views:

57

answers:

2

Me again,

I have a question I would like to ask as a followup.

to submit 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?

God bless

+3  A: 

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() {
    $("#frmToSubmit").submit(); 
});

// With Validation
$("#btnSubmit").click(function() {
    // Will only submit it validate() returns true
    if( validate() ) $("#frmToSubmit").submit();
});
roydukkey
hey thanks worked like a charm. You guys rock
Eagletrophy
@Eagletrophy - you could be courteous and vote the answer up, and accept it if it did solve your problem as you've indicated (not whining or scolding, just sayin'). :)
karim79
A: 

Thank you Mr.roydukkey

The above code doesn't work for me.. But after few changes it works fine.. Here is the code that works fine on my case.

$("#btnSubmit").click(function() { if($("#frmToSubmit").valid()) { $("#frmToSubmit").submit();

     return false;
}
else
{
    return false;
}

});

dremay