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 7668569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:23:48+00:00 2026-05-31T15:23:48+00:00

I have a Backbone Model with validation logic. I have bound the following method

  • 0

I have a Backbone Model with validation logic. I have bound the following method to show the field errors when the validation fails:

this.model.on('error', this.showError);

When I try to set invalid values to my model, the error event is getting fired properly.

this.model.set(invalidValues); // triggers showError method

But if I try to save the object using the same invalid values, the validation fails as expected, but the error event is not getting fired, hence the showError method is not getting called..

this.save(invalidValues, {error:this.failed,success:this.succeeded}); // does not trigger showError

The save does not trigger the error event, but the this.failed is getting called as expected.

So, what do I need to do to make sure the that the on error event is always triggered when there’s a validation error?

  • 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-05-31T15:23:50+00:00Added an answer on May 31, 2026 at 3:23 pm

    When you set the error callback in your save options it overrides the default of backbone, which is to trigger the error event. In your error callback, you can trigger the error event on the model or just call your showError method.

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

Sidebar

Related Questions

Using the following as an example: var Case = Backbone.Model.extend({ initialize: function(){ this.bind(error, function(model,
I have this model var Item = Backbone.Model.extend({ url: 'http://localhost/InterprisePOS/Product/loaditembycategory/Event Materials' }); var onSuccess
I have the following situation: var Task = Backbone.Model.extend({ initialize: function() { }, save:
I'm developing application using backbone.js & jquery. I have following code in model: runReport:
Basically, I want my model to have its own validation logic while having the
I have encountered a strange behaviour of the model validation in Backbone.js. When a
I have simple user model: var user = Backbone.Model.extend({ initialize: function(){ this.bind(change:auth, function (){
Lets have the following code : ( function($) { TeacherModel = Backbone.Model.extend({ defaults :
I have the following Backbone.js model and collection: // Model lr.Event = Backbone.Model.extend({}); //
I have a backbone model called Member - this contains membership data such as

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.