title: Knockout custom validation: How to check if observable is equal to a specific value?
body: <p>I'm new with Knockout.js, and I would like to check if a field of my form has a specific value. Actually, I only check if it is required or not. What should I do?</p>
  
  <p>Here's what I have in my html page:</p>
  
  <pre><code> &lt;div data-bind="visible: !Vm.isValid()" class="text-danger"&gt;Fill each field to send data, otherwise show this message&lt;/div&gt;
  
   &lt;input data-bind="enable: Vm.isValid()" type="button" value="Send data!" /&gt;
  </code></pre>
  
  <p>That's what my vm.js file looks like:</p>
  
  <pre><code> window.Vm = ko.validatedObservable({
       name : ko.observable().extend({ required: true })
   });            
  </code></pre>
  
  <p>I would make something like this, but I don't know how to do it:</p>
  
  <pre><code> var found = "found";
   window.Vm = ko.validatedObservable({
      name: ko.observable().extend({
         required: true,
         function: {
            if (this.val() == found)
               return true; // invalid value, can't submit my form
         }
      })
   });
  </code></pre>