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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:09:14+00:00 2026-06-04T21:09:14+00:00

How do I create a registration form in Backbone js? And send a POST

  • 0

How do I create a registration form in Backbone js? And send a POST to my backend, I don’t understand the idea of a collection in such situation.

What I got so far:

define(['jQuery', 'Underscore', 'Backbone', 'text!templates/signup.html', 'models/UserRegistration'],
function($, _, Backbone, signUpTemplate, UserRegistration){

    var SignUpView = Backbone.View.extend({
        el: $('#screen'),

        events: {
            'submit #frm-signup': 'signup'
        },

        signup: function(){
            // Do something
        },

        render: function(){
            $(this.el).html(_.template(signUpTemplate, {}));
            return this;
        }
    });

    return new SignUpView;
});

And a model:

define(['Underscore', 'Backbone'],
function(_, Backbone){

    var UserRegistration = Backbone.Model.extend({
        url: '/users/reg',
        paramRoot: 'user',
        defaults: {
            'fullname': '',
            'email': '',
            'password': ''
        }
    });

    return UserRegistration;
});

What would be the next step to make it POST to my REST backend server?

  • 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-04T21:09:15+00:00Added an answer on June 4, 2026 at 9:09 pm

    Backbone.Model sends a POST to the server when you call it’s save function. So, assuming you’ve already populated the model from your form when you call signup, then it’s just a case of calling save:

    signup: function(){
                this.model.save();
            },
    

    Alternatively you can pass the details to save into the save function:

    signup: function(){
                this.model.save({
                          fullname: $( '#fullname' ).val(),
                          email : $( '#email' ).val()
                          ...
                          });
            },
    

    It’s maybe worth noting that you’ll need to create the model on the view at some point as well (which your code currently doesn’t seem to do).

    So, when you create the view:

    new SignUpView({ model: new UserRegistration });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I'm trying to create a simple registration form with ajax validation. I've got
I'm trying to create a registration form. In this form there are some fields(username,password
I'd like to create a user registration form where the user ticks some boxes
How to create a multiple step registration form in iOS. Which is the best
I want to create a simple user registration form with First / Last name,
I am trying to create a registration form (just for practice) and saw this
I want to put 2 fields on user registration form, /customer/account/create/. Those fields are
I need to create registration form for an event. Each person that register can
I want to create registration form for my website but my server is not
I'm trying to create a registration form and validate input fields using javascript, but

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.