Usman Ali
Usman Ali

Reputation: 15

Once form is submit on the same page, its not submitting again using jquery until i refresh page

I am trying to submit my form on the same page using jquery. When this form is submitted and again i try to submit i am failed. and when i refresh page and submit it works fine. whats the problem?

$('#csvFile').change(function(){
    $("#senderInfoForm").submit();
});

Upvotes: 0

Views: 36

Answers (1)

Mohamed-Yousef
Mohamed-Yousef

Reputation: 24001

this is the code I use for trigger submit a form in .change()

$('#csvFile').on('change',function(){
    $('#senderInfoForm').trigger('submit');
});

be sure that #senderInfoForm is your form id not a submit button id .. and for submit a form

$('#senderInfoForm').on('submit',function(){
   // code here
});

Upvotes: 1

Related Questions