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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:26:45+00:00 2026-05-30T18:26:45+00:00

I trying to generate forms with Backbone.js, Here is how I am doing it

  • 0

I trying to generate forms with Backbone.js,

Here is how I am doing it now.

Each Input element on the form has a Model and a View. So as usual the model contains attributes like type value name placeholder etc .

By backbone convention I have gotten changes to Model reflecting on the UI

But I want the reverse also to happen,
that is when the value of an input element changes that has to reflect upon the model’s attribute value.

Here is where I am right now:
prototype1.js

I am thinking of writing a update method on the view which will update the model, something like this. Is there a better way to do it ?

PS :

This has not helped much stackoverflow search: backbone.js reverse model binding

Any general advice is also welcome along with the answer.

  • 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-30T18:26:46+00:00Added an answer on May 30, 2026 at 6:26 pm

    Have you ever heard of backbone.modelbinding?
    it’s a plugin created by Derick Bailey, that was brought to live especially for that purpose,

    once a model changes, it updates the view,
    once the view changes it updates the model.

    i’ve used it before, and it works very well for a straight forward form,
    as for now i don’t see why it wouldn’t work with your form,
    but you’d have to try it out and see whether your structure fits.

    initializing is quite easy:

    SomeView = Backbone.View.extend({
      render: function(){
        // ... render your form here
        $(this.el).html("... some html and content goes here ... ");
    
        // execute the model bindings
        Backbone.ModelBinding.bind(this);
      }
    });
    

    that is the basic straightforward binding,
    you can go mutch further than that:

    you can bind model to view that does not render (already in the page)
    you can bind to multiple model properties
    you can do binding through data-bind style attributes in the form if you would want that
    you can bind to a model’s events

    lot’s of options, so take a look at it and see if it fit’s your app.

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

Sidebar

Related Questions

So I am using the form helper to generate my forms. Up until now
I wrote a short snippet to dynamically generate all of my model forms within
I'm trying to generate form elements with jQuery to send to a Paypal form,
I'm trying to generate 900,000 keys and store them to a db. Each value
I'm trying to generate a form using the form_for helper in RoR but I
I have a form with 2 input fields email and password(hidden) . I'm trying
I am trying to make a dynamic form using Spring forms. Basically, the form
I'm currently attempting to generate form elements in Symfony based on the application's model.
I'm trying to dynamically generate a pdf form from an asp.net C# application. The
I'm trying to generate a query dynamically using textbox values from my Bookings form

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.