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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:38:13+00:00 2026-06-14T03:38:13+00:00

I have a Backbone view with a form. When the user submits a form

  • 0

I have a Backbone view with a form. When the user submits a form there can be a validation error, that is handled by the backend.
After I display the error, I want the form to be usable again. I thought I should just do this.delegateEvents(), but for some reason it did not work…

Here is the code:

class App.Views.PlotsCreate extends Backbone.View
  template: JST['plots/create']

    events:
        'submit #new_plot': 'createPlot'


    createPlot: (event) ->
      event.preventDefault()
      @attributes = plot: {name: $('#new_plot_name').val(), docreate: "true", code: code }
      @collection.create @attributes,
        wait: true
        success: (plot) => 
          document.body.style.cursor = 'default'
            @showProgress(plot)
        error: @handleError
      )

    handleError: (entry, response) =>
      if response.status == 422
        errors = $.parseJSON(response.responseText).errors
        for attribute, messages of errors
          $('#new_plot_name').val("#{message}" for message in messages)



    <form class="new_plot" name="create_form" id ="new_plot"  data-remote="true" enctype="multipart/form-data">
      <textarea class="input" id="new_plot_name" name="name" rows="5" maxlength = '140'></textarea> 
      <input class="blue_button btn_generate" name="commit" type="submit" value="create" id ="plot_subm"/>
    </form>   

How do I make the form become functional again (i.e. submit event firing again after the error was displayed)

  • 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-14T03:38:15+00:00Added an answer on June 14, 2026 at 3:38 am

    Failing validation doesn’t normally do anything to event bindings; in fact, technically the view doesn’t even have a validate method, only models do (and all that method does is trigger an ‘error’ event and return false). Are you sure you don’t have some code on your end that’s breaking the view?

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

Sidebar

Related Questions

I have backbone view that binds an action to an element in the DOM.
I have a Backbone View that has a Collection as its Model. If the
I have created a street view backbone view. The problem is that when shown,
I have a standard list view setup with backbone that looks something like below.
In my Backbone application I have a main view that shows previews of posts.
I have a backbone view that calls to a sub-view: lr.MapView = Backbone.View.extend({ el:
I have a backbone app with a view structure that looks like the following
I have a basic form with a backbone view, when I press enter on
i have a backbone view that renders a model to screen. When the model
I have a backbone view - which when called presents a form $('#add-offer').click(function() {

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.