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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:39:07+00:00 2026-06-05T08:39:07+00:00

I have a strange problem, at least I think it is strange. The following

  • 0

I have a strange problem, at least I think it is strange.

The following will show nothing:

<input type="text" data-bind="value: selectedAddress.street1" />

But, if binded like this then it shows the correct value, but doesn’t update (shows the value but does not seem to bind to object):

<input type="text" data-bind="value: ko.toJS($data).selectedAddress.street1" />

I checked if the selectedAddress object actually contains data with:

JSON.stringify(ko.toJS(selectedAddress), null, 2)

And it does

{
 "id": 5631,
 "street1": "Some Adress 43",
 "street2": null,
 "postcode": "15850",
 "city": "GhostTown",
 "country": "UK",
 "addressTypes": []
}

How to get the input field to correctly bind to the object property and display/update value accordingly?

ViewModel:

var theViewModel = function() {
        var self = this;
        self.no = ko.observable();
        self.name = ko.observable();
        self.addresses = ko.observableArray([]);
        self.selectedAddress = ko.observable(new Address());
        ...
}

What am I doing wrong?

  • 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-05T08:39:08+00:00Added an answer on June 5, 2026 at 8:39 am

    Parenthesis are optional only in some cases, but not when referring to a property of an object (that may or may not be the value of an observable). Therefore, you need to explicitly use parenthesis to get the value of the observable selectedAddress. Then, you may refer to the property street1 of this object (parenthesis are now optional):

    data-bind="value: selectedAddress().street1"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have strange problem with receiving data from socket. On client im using air
I have a strange problem with some documents on my webpage. My data is
i have strange problem doing reporting: i have numerous clients with different issued invoices.
I have a strange problem with lxml when using the deployed version of my
I have a strange problem that is only happening in a single location. I
We have a strange problem when implementing sessions with ColdFusion in IE6. After login
I have a strange problem that I could not solve. When I try to
I have a strange problem, a deadlock problem, where if I pause the program
I have a strange problem. Could someone explain me why : If I have
I have a strange problem which I can't fix: A field: private boolean[][][] gaps;

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.