I am creating an application which has a slide in and slide out window. This slide in and slide out window has a form which the user needs to fill. On click of the ‘Save’ button the POST request is fired. Everything goes well till here. But the second time when the user tries to post, there are 2 POST requests sent over network, the first request has the older data and the 2nd request carries the new data. Third time, when the user fills the form, 3 POST requests are sent.
I am using backbone to create this application, I tried cleaning up the views before sending the data, but that didn’t work, can someone suggest me where am I going wrong?
I am creating an application which has a slide in and slide out window.
Share
Check your events and make sure that you don’t have a submit event and a click event.
Also, if you are rendering the view several times, you might end up with several events attached to one button.
It would be helpful if you had some code so we could actually see what is going on. As @fbynite noted, you might also check your event bindings.