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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:58:46+00:00 2026-06-13T01:58:46+00:00

I am using Knockout.js and i am pretty new in this. I created a

  • 0

I am using Knockout.js and i am pretty new in this. I created a Example to my problem. Here i am trying to bind the knockout binding to dynamically generated elements. But the binding are not applied properly to dynamically generated elements.

I am trying to synchronize the input text field with label element. So whatever we enter in the input field the same text will reflect in its corresponding label element. Please forgive me if i am not clear with my question and please ask me for clearance. Help me guys ? 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-13T01:58:48+00:00Added an answer on June 13, 2026 at 1:58 am

    In your code you are not using one of the main feature of knockout – auto-generating html. Instead of using jQuery to add new row – use knockout foreach binding with observableArray. When you add new item to array knockout will automatically generate html markup.

    Javascript:

    function CourseViewModel(){
        var self = this;
        self.textValue = ko.observable('');
    }
    
    function CeremonyViewModel() {
        var self = this;
    
        self.cources = ko.observableArray([new CourseViewModel()]);
    
        self.addCourse = function(){
            self.cources.push(new CourseViewModel());
        };
    }
    
    ko.applyBindings(new CeremonyViewModel());
    

    Html:

     <div id="menutab">
        <form id="createMForm">
            <input type="button" id="createmenu" value="Add menu" data-bind="click: addCourse"/>
            <div class="menu">
                <table data-bind="foreach: cources" class="ui-widget ui-widget-content" >
                    <tr>
                        <td>
                            <label for="CourseName">CourseName</label>
                        </td>
                        <td>
                            <input type="text"  data-bind="value: textValue, valueUpdate:'keyup'" class="CreateCourseName" name="CourseName" />
                        </td>
                    </tr>
                </table>
            </div>
        </form>
    </div>
    <div id="courseoptiontab">
        <form id="createCOForm">
            <div class="options">
                <table data-bind="foreach: cources" class="ui-widget ui-widget-content">
                    <tr>
                        <td>
                            <label class="colabel">Course Name
                                <span class="forcourse" data-bind="text: textValue"></span>
                            </label>
                        </td>
                    </tr>
              </table>
           </div>
        </form>
    <div>
    

    Here is working fiddle: http://jsfiddle.net/vyshniakov/g5vxr/

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

Sidebar

Related Questions

With Knockout 2.0 using this data-bind: data-bind=click: $root.deleteSomeEntity.bind($data, $parent) in the Knockout viewmodel JavaScript
I'm trying to use knockout to do a pretty basic binding but am having
Using knockout.js I've run into this problem a couple of times now. It seems
I am using Knockout javascript library, and I run into this problem: I am
I am trying to create a group of dropdowns using knockout out that allow
I am using Knockout JS library to bind the HTML5 input controls in my
I'm working with a new application at work that we're building out using Knockout.js
I am using Knockout JS in combination with this combobox extension for jQuery: http://source.dellsala.com/jquery-combobox/demo/
I am new to jQuery and I am using jQuery 1.7.1 to learn Knockout
So I'm trying to follow a tutorial for Knockout, unfortunately the tutorial is using

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.