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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:02:46+00:00 2026-06-14T18:02:46+00:00

There are few forms in my project which involve lot of validations and server

  • 0

There are few forms in my project which involve lot of validations and server calls. So, I thought of using 'backbone-forms.js' for these. Currently I am playing around with this code : http://jsfiddle.net/evilcelery/VkUFu/ to see if 'backbone-forms.js' caters to all my needs.

Surely we can give our own custom templates to individual components like ‘list’, ‘date’ etc as defined in https://github.com/powmedia/backbone-forms#customising-templates. But in my workplace, all html templates should be independent from the javascript implementations so that the classes and markup can be edited based on the needed appearances (javascript coding is based on the field ids which will not be altered). My problem is that I am unable to use my own custom template for the forms built using 'backbone-forms.js'.

Is there any way to make the template.html independent from javascript(like in case of handlebars.js) ?

Is there someway that we can use a compiled handlebars template with all form fields in the template.html and using Backbone.Form functionality or is this not possible?

Thanks.

  • 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-14T18:02:47+00:00Added an answer on June 14, 2026 at 6:02 pm

    If I understand your question well, you would like to load html templates from individual sources dynamically (like from …/templates/category.html) instead of letting BackboneForms render it from the schema or having to define them in an ugly way in the javascript code like here

    You can load your html template on the go as a string with ajax (or better, with Require.js) and call Backbone.Form.setTemplates({templateName: templateBodyAsString}). It won’t override other already registered templates with other names, see setTemplates‘s implementation below.

    If you use $.ajax(), you can put your form rendering code in the success callback. If you use Require.js, it will be easier, not to mention its caching mechanism, if all of your BB modules/forms load their own templates every time, then Require.js will only do the ajax request first time a module needs the same template.

    The body of the Backbone.Form.setTemplates function:

    function (templates, classNames) {
        var createTemplate = helpers.createTemplate;
    
        Form.templates = Form.templates || {};
        Form.classNames = Form.classNames || {};
    
        //Set templates, compiling them if necessary
        _.each(templates, function(template, key, index) {
          if (_.isString(template)) template = createTemplate(template);
    
          Form.templates[key] = template;
        });
    
        //Set class names
        _.extend(Form.classNames, classNames);
      } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that's locked down using forms authentication. There are few nightly
In my C# 3.5 Windows Forms application, I have a few SplitContainers. There is
I'm converting an old VB form to .NET, and there a few Buttons which
in my page there are few hidden field which are filled with the correct
It looks like there a few working solutions for using custom true type fonts
hopefully there's an easy solution to this one. I have my MVC2 project which
I am using DevExpress in my Winform project, and in my form there are
I am working on a project in which there has to be a functionality
I am using VSS for my ASP.NET (VS 2008) project which is used by
I am working on project which includes communication of the server (JavaEE app) and

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.