I'm using the twitter bootstrap modal plugin. The submit from the modal submits data to the server.
For some reason, when I open and submit the modal multiple times the submit is firing as many times as the modal has been opened previously.
So if I click "update" on a row. Edit and save, it fires once since that's the first attempt. If I then click "update" on a second row. Edit, and save, it fire's twice. 3rd time fires 3 times, 4 fires 4. So on, so forth.
I've been trying to resolve this for days now and have found nothing. Some guidance would be leave me eternally grateful.
This is how I have fixed this issue:
I have a global variable
delete_id=0
just after the<script>
tag to store the ID which I want to delete (this can be dynamic to use server side script). I have also added IDmyModalAction
for theDelete
button in my modal HTML.I have called the modal this way:
And for
myModalAction
:Complete working code can be found here.