7👍
Replace this:
$( "#todoform" ).submit(function(e)
With this:
$( "#todoform" ).unbind('submit').submit(function(e)
1👍
Probably onload()
is being called twice, check all occurrences of it through your code. If you call .submit()
twice, the onsubmit event is appended with the code given, not replaced.
To debug, put an alert('anything')
inside sendtodo()
and check if it’s really being called twice when submitting.
You can also do:
$('#todoform').removeAttr('onsubmit').submit( ...
But it would be better to find out why it’s being bound twice
- [Django]-Django.core.exceptions.FieldError: Cannot resolve keyword 'timestamp' into field
- [Django]-My custom heroku python buildpack downloads requirements on every push
Source:stackexchange.com