Very Peculiar - Submit Once The First Time, Twice The 2nd Time, Trice The 3rd Time .. And So On .. What I Did Wrong?
Working with a modal form that submits edited information via ajax post. The thing is, it submitted once the first time .. fire up the modal form again, then submit, and twice it g
Solution 1:
Every time you click, you're adding a new event handler:
$('#smallModal').on('shown.bs.modal'//...
Are you sure you want to do this on "click", or might it be better to set this up outside of the click handler?
In fact, you're binding event handlers as a response to other events all over this code. That's probably not a great idea, unless you unbind them once you're done.
Solution 2:
You need to pull out your binders, you bind a new time every time the button is clicked! Only bind on load, not under button click event.
Post a Comment for "Very Peculiar - Submit Once The First Time, Twice The 2nd Time, Trice The 3rd Time .. And So On .. What I Did Wrong?"