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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:59:41+00:00 2026-06-14T01:59:41+00:00

I have an input text like below: <input type=text style=width: 80% data-bind=value: Note, event:

  • 0

I have an input text like below:

<input type="text" style="width: 80%" data-bind="value: Note, event: { blur: $root.UpdateNote}" />

It contains the value of observable variable Note. And on blur it updating note.
My problem is to check the previous value of note with current value of note before updating.

Here is my constructor containing all variables

function Goal(data) {
var self = this;

self.GoalID = data.GoalID;
self.Note = ko.observable(data.Note);

}

In my viewmodel i have declared note as observable variable like below:

self.Note = ko.observable();

In knockoutjs, how to get previous value of an observable variable??

  • 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-14T01:59:42+00:00Added an answer on June 14, 2026 at 1:59 am

    You can subscribe to Note observable changes and specify “beforeChange” parameter to get old value:

    function Goal(data) {
        var self = this;
    
        self.GoalID = data.GoalID;
        self.Note = ko.observable(data.Note);
    
        self.Note.subscribe(function(oldValue) {
            console.log(oldValue);
        }, self, "beforeChange");
    
    }
    

    Here is an example: http://jsfiddle.net/vyshniakov/HACbc/

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

Sidebar

Related Questions

I have some input fields like below: <input type=text name=date_1 class=dataList value=2009-12-30 /> <input
I have a input field like below, <input name=update_price type=text id=update_price value=£ size=8 maxlength=8
I have form like this: <div class=satu> <input type='text' size='1' maxlength='1' name='score[1][]' id='score[1][]'> </div>
I have some HTML like this: <input type=radio class=MyRadio name=TheName> <label for=TheLabel>the text</label> How
I have created table like below: <table data-bind=with: choosenDateGoal> <tbody data-bind=foreach: tblGoals> <!-- ko
i have a input elements as below <form method=post > 1 <input type=text name=passname[name]
I have a form written below: <table> <tr> <td>Worker Type:</td> <td><input type=text id=WorkerTypeTB/></td> </tr>
I have a text input field like text box or text area. I want
I have input text: <div><label wicket:for=name>Name</label><input type=text wicket:id=name /></div> Now I need to add
I have some javascript code like below function mask(eventVal,val){ var len = val.value.length; var

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.