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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:39:36+00:00 2026-06-01T13:39:36+00:00

When I click the save link for a new blog topic, the console output

  • 0

When I click the save link for a new blog topic, the console output is empty values for the topic object. When I click the save link for a existing blog topic, the output is the old values for the topic object.

Why isn’t the values being assigned the property when the save link is clicked?

 var viewModel = function(topics){
        var self = this;
        self.topics = ko.observableArray(topics);
        self.editing_topic = ko.observable("");

        self.new_topic = function(){
            self.edit_topic({});
        }

        self.edit_topic = function(topic){
            self.editing_topic(topic);
            form.dialog({width:800, height:600, modal:true});

        };

        self.save_topic = function(){
            console.log(self.topic());
        };
    };
   ko.applyBindings(new viewModel(jsondata));

<fieldset class="blog_topic_form" title="New Blog Entry">
    <div>
        <label for="topic_title">
            Title:
        </label>
        <input type="text" id="topic_title" data-bind="value: topic().topic_title"/>
    </div>
    <div>
        <label for="message_contents">
            Message:
        </label>
        <textarea id="message_contents" class="message_contents" data-bind="value: topic().message_contents"/>
    </div>
    <footer>
        <a class="save_link" data-bind="click: save_topic"></a>
        <a class="cancel_link"></a>
    </footer>
</fieldset>

Edit:
Here is the jsfiddle:
http://jsfiddle.net/jLkxG/3/

When you run it, it will assign the default values. However, if you edit the textbox and click savelink, it will output the original (initial) values instead of the values entered in the textbox.

  • 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-01T13:39:37+00:00Added an answer on June 1, 2026 at 1:39 pm

    Please update your code to match the code in the jsfiddle.

    In the jsfiddle, your editing_topic properties (topic_title and message_contents) should be defined as observable, not the editing_topic property itself.

    I’ve updated your jsfiddle to work correctly: http://jsfiddle.net/jLkxG/4/

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

Sidebar

Related Questions

Here is the code. On click of the link , the save as dialog
my ajax is : $('#save').click(function(){ $.post(http://127.0.0.1:8080/sss, function(data){ alert(data); }); }) and the django view
I currently have a simple form that when you click the save button will
I am using the TSaveDialog component to save a file from a button click.
$('#ms_cats_meta_eduyear, #ms_cats_meta_semester, #ms_cats_meta_subject').change(function () { $('#publish').removeClass('button-primary-disabled'); $('#save-post').removeClass('button-disabled'); $('input#publish').click( function () { var eduyear_val =
Click on this link , you will be redirected to a shopping site. On
I click on a link from one page that does a redirect to another
When I click on the delete link I created, it doesn't do anything (even
I'm new and just developing on J2EE. I am modifying an existing application (an
As the title says. I want to create TooltipDialog, after I click link 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.