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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:12:27+00:00 2026-06-11T20:12:27+00:00

I am using knockout for the first time and I am trying to make

  • 0

I am using knockout for the first time and I am trying to make a web page to allow a user to create a list of items that contains an image url. I have managed to databind the img src attribute but if I update it later with a jquery function, when it comes to save the knockout model the new src value is not taken.

Here is a fiddle of a simplified version of my page – http://jsfiddle.net/TurUh/4/

If you click the save button you can see the model takes the original image src (test.png). If you then use the Change Images button the image src is updated to (changed.png), you can test with firebug to confirm the html is changed. If you then click the save button again, the model uses the old src value (test.png).

Am I doing something wrong? Can anyone suggest how to resolve this issue?

  • 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-11T20:12:28+00:00Added an answer on June 11, 2026 at 8:12 pm

    You’re on the right track, but you’ve moved away from using Knockout objects latter on in your code, rather than updating your ViewModel on the button clicks.

    I’ve updated your code here in order to function properly, see what you think:

    http://jsfiddle.net/TurUh/6/

    For anyone else tackling this problem, the changeImage function needs putting into the ViewModel and the ViewModel objects require updating, such as:

    // Update the whole project array
    self.changeImages = function() {
       for(var i=0; i < self.projects().length; i++)
       {
             self.projects()[i].ImageURL('changed.png');
       }
    };
    

    Bear in mind that the ImageURL also needs making into an observable object, within the project array.

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

Sidebar

Related Questions

I am trying to create a group of dropdowns using knockout out that allow
I'm trying to make a list item draggable in a project that is using
I am using knockout.js and upshot.js to get a list of items from API
I am trying to populate Select using knockout data-bind option for a list of
I'm using the latest versions of knockout.js and jquery. I'm trying to create a
i'm building an MVC3 site and using Knockout / JSON for the first time,
I am trying to delete an item from a list. I am using knockout.js
Quite a few examples I see of using knockout when showing a list of
I'm trying to build some HTML with Knockout that Jquery UI can turn into
I am trying to setup generic Knockout templates that can be toggled between edit

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.