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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:33:55+00:00 2026-06-07T03:33:55+00:00

My question is why my two data-bound input fields are behaving differently when I

  • 0

My question is why my two data-bound input fields are behaving differently when I clear them, even though as far as I can tell they are set up the same way as calculated observables in knockout.

Using this fiddle:
http://jsfiddle.net/ya7eF/167/

The ‘min’ field is working properly, the ‘hrs’ field is not. To reproduce my problem, follow the steps below. When I remove text from Duration ‘hrs’ field, I want to understand why it is not replaced with zero on blur, like the min field.

  1. Delete text (’30’) from second Duration (‘min’) text field, then lose focus on that field. Empty string gets replaced with zero, and other computed observables (end time) are updated. As desired.
  2. Re-run the fiddle.
  3. Delete text (‘0’) from Duration ‘hrs’ text field
  4. Blur ‘hrs’
  5. Nothing happens; the ‘read’ method for the computed observable for hours never even gets called. I can’t figure out what the difference is between the two observables.
  • 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-07T03:33:57+00:00Added an answer on June 7, 2026 at 3:33 am

    In the second case the value of the Duration observable did not actually change. When an observable’s value is set to its current value, then no notifications are sent out to subscribers. This means that the read functions of your computed observables are not triggered.

    One technique to deal with this concern is to use an observable’s valueHasMutated function to ensure that notifications are sent out. To avoid multiple notifications, you could do something like:

            if (totalMinutes !== self.Duration()) {
                self.Duration(totalMinutes);
            }
            self.Duration.valueHasMutated();
    

    Here is your sample updated: http://jsfiddle.net/rniemeyer/ya7eF/168/

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

Sidebar

Related Questions

my question is about two possible ways to access data: (My question is about
This question is a bit of a two parter for .Net data services. This
I have two question to put forward: I was very interested, even intrigued by
I have two Tables: Table 1: Questions : QuestionId NUMERIC Title TEXT Test Data
Two question on Bluetooth development on Android: Is there a way to enable Bluetooth
This question has two parts. Part 1. Yesterday I had some code which would
My question has two parts: Is it possible that, if a segfault occurs after
The question has two parts, one of which I already have the answer for.
This question has two parts (maybe one solution?): Sample vectors from a sparse matrix
guys I have two question to ask, they're easy, but bothering me for a

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.