Reputation: 15
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
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