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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:36:15+00:00 2026-06-02T10:36:15+00:00

I am using KnockoutJS to write a small application where a user can edit

  • 0

I am using KnockoutJS to write a small application where a user can edit a “product” by typing in text to input fields that will automatically update viewable text boxes on top of an image. This allows the user to preview engravable lines before purchasing for instance a Plaque.

So here is my problem:

I have an object (product) that holds an observableArray (product.lines):

self.product = ko.utils.arrayMap(jsonData, function(data) {
    return new CustomizableProduct(
    data.sku, data.name, data.lines, data.fonts, data.plates)
});
function CustomizableProduct(sku, name, lines, fonts, plates) {
  return {
    sku: ko.observable(sku),
    name: ko.observable(name),
    lines: ko.observableArray(lines),
    fonts: ko.observableArray(fonts),
    plates: ko.observableArray(plates)
  }
}

jsonData:

var initialData = [
{
"sku": "PMW",
"name": "Premium Genuine Walnut Step Edge Plaque",
"plates": [
    {
    "sku": "plateSKU",
    "name": "plateName",
    "img": "/images/plates/plateSKU.jpg"},
{
    "sku": "plateSKU2",
    "name": "plateName2",
    "img": "/images/plates/plateSKU.jpg"}
],
"lines": [
    {
    "label": "Line 1",
    "value": "Line 1",
    "type": "input",
    "characterLimit": "146"},
{
    "label": "Line 2",
    "value": "Line 2",
    "type": "input",
    "characterLimit": "156"},
{
    "label": "Line 3",
    "value": "Line 3",
    "type": "submit",
    "characterLimit": "176"}
],
"fonts": [
    {
    "font": "Times New Roman"}
]}
];

product.lines is looped and creates input boxes with its default value set from the object (value: $data.value). these input boxes are editable by the user. I also need to display the value of the input box as its updated sort of to act as a preview of what is being typed. When I type in a new word it updates in the object but the field that needs to display the value does not update.

I have a jsFiddle of my code here: http://jsfiddle.net/pR6xp/2/

What do I need to write to get that value to update when its updated by editing the input field?

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-02T10:36:17+00:00Added an answer on June 2, 2026 at 10:36 am

    You create an observableArray of lines but when objects are added to an observableArray their properties do not become observable, this is left upto you to implement.

    I added a ProductLine object with an observable value and initialized the lines collection with these objects.

    http://jsfiddle.net/vRBhP/1/

    Hope this helps.

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

Sidebar

Related Questions

I am using KnockoutJS and I have an input control that displays a number
Using PyObjC , you can use Python to write Cocoa applications for OS X.
I'm trying to bind a 1-many mapping using KnockoutJS, where 1 zip code can
Using KnockoutJS, how can I remove an item from an observable array? I want
I am trying to figure out the best ways of using KnockoutJS and I
I have a simple HTML table which is bound using knockoutJS. However, I've added
I am learning knokcout.js I was using the example in http://www.knockmeout.net/2011/04/utility-functions-in-knockoutjs.html , which is
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Using TortoiseSVN against VisualSVN I delete a source file that I should not 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.