I'm trying to handle multiple forms with ajax. Suppose I have #formA, and #formB. And in the submitForm() function, I have the following:
function submitForm() {
var currentForm = $(this);
if (currentForm == "#formA") {
//do this
}
else if (currentForm == "#formB"){
//do that
}
}
However this approach is not working. What is the best way to deal with this? Thanks in advance.