Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8272631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:11:43+00:00 2026-06-08T07:11:43+00:00

I have a view on my form submit i am getting multiple calls hence

  • 0

I have a view on my form submit i am getting multiple calls hence multiple records are being called. How do i stop getting multiple calls ?

After first records gets saved , when i try to save another record it gets saved two times, then three times, goes on increasing as i go on adding the records.

I have given the event in another view as

events: {

         "submit" : function(){$('#newWaitlistForm').submit();},

},

My form view is

var FormView = Backbone.View.extend({

el: "#newUser",

template: $.template( null, $('#newUser-tmpl') ),


events: {
   "submit" : "submit",

},

initialize: function() {
    this.render();
},

submit: function(e){
    var self = this;    
    console.log('submit');
    e.preventDefault();
    e.stopPropagation();
    var model = new Reservation($('#newWaitlistForm').serializeObject());
    var saved = model.save(null, {
        success: function(data){
            console.log({'success': data});
            //waitlist.add(data);               
            self.$el.find('input,textarea,select').val('');             
            self.goBack();
        },error: function(model, response) {
            console.log({'error': response});
        }
    }, {wait:true});
    console.log({saved: saved});
},

goBack: function(){
    $('.current').removeClass('current');
    $('.main').addClass('current');
},
render: function(){
    this.$el.html($.tmpl(this.template,{}));

    this.$el.find('input[name="phone"]').mask("(999) 999-9999");
    var today = Date.parse('now').toString('MM/dd');
    return this;
}
  });

What is it that i am doing wrong ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T07:11:45+00:00Added an answer on June 8, 2026 at 7:11 am

    One possible source of this issue is the place where you are creating your backbone view. If you are creating a new view for each record you are trying to save, then you need to make sure you have disposed off the previous view properly by unbinding all of its events. Otherwise all views in memory will get the submit event and handle it. This post explains the problem and offers a good solution to this problem:

    http://lostechies.com/derickbailey/2011/09/15/zombies-run-managing-page-transitions-in-backbone-apps/

    Basic idea is to have your view define the following functions:

        bindTo: function(model, ev, callback) {
          model.bind(ev, callback, this);
          return this.bindings.push({
            model: model,
            ev: ev,
            callback: callback
          });
        },
        unbindFromAll: function() {
          _.each(this.bindings, function(binding) {
            return binding.model.unbind(binding.ev, binding.callback);
          });
          return this.bindings = [];
        },
        dispose: function() {
          this.unbindFromAll();
          this.unbind();
          return this.remove();
        }
    

    You can put these functions in a view base class for reusability.

    You should then define a helper function to show and newly created views. Something like:

    showView: function(view) {
          if (this.currentView) {
            this.currentView.dispose();
          }
          this.currentView = view;
          this.currentView.render();
    
        }
    

    You should bind events to views using the bindTo method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello i have a list view control, While the form is being loaded i
I'm having problems binding on a form with multiple models being submitted. I have
I have a form view which people use to update a record in the
In my app I have a view that is a form that has quite
I have the follwoing form in my view : I have an instance variable
if i have created a view model and have a partial form that is
I'm making a simple search form in rails. In my search view I have
Greetings! I'm doing a Form on ASP.NET MVC 2, in my view I have
I have two form fields on my view page, a date input (with a
I have a form in a Code Igniter view in my jQuery Mobile application.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.