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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:46:24+00:00 2026-06-09T04:46:24+00:00

I have an example jsfiddle here that generates some html content based on a

  • 0

I have an example jsfiddle here that generates some html content based on a server model (local in the example provided) using knockout mapping.

http://jsfiddle.net/QShrA/

How do I create a new address block for the nested address?
i.e. How do I create a button called ‘Add New’ and have that create an empty address block at the bottom?

Thanks in advance for any assistance provided.

EDIT – REOPENED

The problem isn’t solved. I noticed that after I implemented Bill’s solution (below) my computed observable’s for the newly added address block don’t work because they’ve been disabled. Hope someone can figure this out. Thanks.

  self.SMMDD = ko.computed({
        read: function() {
            **if ($.isFunction(self.SMONTH)) {**
                return self.SMONTH() + "/" + self.SDAY();
            **}**
        },
        write: function(value) {
            self.SMONTH(value.substring(0, 2));
            self.SDAY(value.substring(2, 4));
        },
        owner: self
    });

EDIT – SOLVED

Adding the deferEvaluation option appears to have fixed the issue.

  self.SMMDD = ko.computed({
        read: function() {
            return self.SMONTH() + "/" + self.SDAY();
        },
        write: function(value) {
            self.SMONTH(value.substring(0, 2));
            self.SDAY(value.substring(2, 4));
        },
        owner: self,
        deferEvaluation: true
    });
  • 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-09T04:46:25+00:00Added an answer on June 9, 2026 at 4:46 am

    Here is a forked/fixed version in which I uncommented your button and wired it up so that it adds an empty address to the array.

    http://jsfiddle.net/RLNPa/

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

Sidebar

Related Questions

Here is a live example of my problem http://jsfiddle.net/littlesandra88/xksB9/ I would have expected that
Here's an example: http://jsfiddle.net/7g8GD/1/ Once you have entered an invalid input and hit enter
Here's an example of my problem on jsFiddle. I have a table with striped
Ok, if you go here: http://jsfiddle.net/RarFB/2/ You will see the work that I have
So here is the issue, I have 6 divs that are using jQuery UI
Okay, here's an example: http://jsfiddle.net/jGLvk/405/ If you hover the 9012 menu, you will have
Helly guys, first here the jsfiddle example and here my problem. I have 3
Update : Added simple test example http://jsfiddle.net/7UhrW/1/ using normalize.css. Chrome/WebKit and Firefox have different
Take the example I have setup at http://jsfiddle.net/vEF6y/ Click on the 'add item' button
I have created a little example,please have a look, http://jsfiddle.net/bWTwL/ I want to have

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.