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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:19:07+00:00 2026-06-14T03:19:07+00:00

Lets say I have name = ko.observable(‘John’) that is bind to the input as

  • 0

Lets say I have name = ko.observable('John') that is bind to the input as value. I need to show (hidden before) <button>Save</button> if name get changed. So if I edit name from John to Jack then save button should appear and if edit back to John it should hide again. Have you any ideas of what kind of binding/extension can be applied here?
Great 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-14T03:19:08+00:00Added an answer on June 14, 2026 at 3:19 am

    What you need is called dirty tracking.

    There is a ko plugin called KoLite which contains a dirty flag implementation (you can read about how it works in this article):

    The usage is very simple you just need to pass your obserables into the ko.DirtyFlag (this will return computed observable) method:

    var ViewModel = function() {
        var self = this;
        self.name = ko.observable('John');
        self.dirtyFlag = new ko.DirtyFlag(self.name);
    }
    

    And in your view you can bind to the isDirty property on your dirtyFlag:

    <input type="text" data-bind="value: name, valueUpdate: 'keyup'"/>
    <div data-bind="if: dirtyFlag().isDirty">
        <button>Save</button>
    </div>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
    

    Demo fiddle.

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

Sidebar

Related Questions

Lets say that you have a following simple application: <form action=helloServlet method=post> Give name:<input
Lets say we have got rows like that: MyTable ID Name Product ------------------ 1
Lets say I have following: library(XML) my.xml <- ' <tv> <show> <name>Star Trek TNG</name>
Lets say I have two tables table_1 ID Name Status 1 John 2 Peter
Lets say I have an asp.net label that has the value: Label1.Text = Hello
Lets say I have a database that looks like this: tblA: ID, Name, Sequence,
lets say i have the following XML <?xml version=1.0 encoding=utf-8?> <names> <name first=John last=Doe/>
Lets say I have a Hash called person whose key is name and value
Lets say i have a table with the following data Customer table: Name amount
Lets say I have a table with columns such as: ID Name City State

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.