0

How do i submit multiple forms in a single page using jQuery Form Plugin

http://malsup.com/jquery/form/

Normally for one form i use below code

$(document).ready(function() {
    $('#MyForm').on('submit', function(e) {
        e.preventDefault();
        $('#submitButton').attr('disabled', '');
        //show uploading message
        $("#output").html('Working.. Please wait..');

        $(this).ajaxSubmit({
            target: '#output',
            success: afterSuccess //call function after success
        });
    });
});
function afterSuccess() {
    $('#submitButton').removeAttr('disabled'); //enable submit button
}

And form HTML

<form id="MyForm" action="submit.php" method="post">

<--- Form elements -->

</form>

So if i have unlimited number of forms with different id's MyForm_1, MyForm_2, MyForm_3 etc. how can i use form plugin to submit them?

3
  • 1
    This might help you : stackoverflow.com/a/16638263/2156244 Commented May 6, 2016 at 12:38
  • 1
    You really don't need a plugin to submit forms. Commented May 6, 2016 at 12:38
  • @PraveenKumar i know that i don't need but I like using that plugin. Commented May 6, 2016 at 12:56

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.