title: Knockout validation plugin - isValid( ) always returns true
body: <p>I am using knockout-validation , when try to check the isValid property it is always true. any advice is much appreaciated.</p>
  
  <p>my html markup</p>
  
  <pre><code>&lt;div class="login"&gt;
          &lt;h1&gt;
              Customer login&lt;/h1&gt;
          &lt;form action="/Home/login" method="post"&gt;
          &lt;div class="fontStyle"&gt;
              &lt;fieldset&gt;
                  &lt;legend&gt;&lt;/legend&gt;
                  &lt;div&gt;
                      &lt;label for="User-id"&gt;
                          User Id&lt;/label&gt;
                      &lt;input id="User-id" name="username" data-bind='value:UserName, valueUpdate: "afterkeydown"'  type="text" value=""/&gt;
                      &lt;span data-bind='visible: UserName.hasError, text: UserName.validationMessage'&gt; &lt;/span&gt;
                  &lt;/div&gt;
                  &lt;div&gt;
                      &lt;label for="Password"&gt;
                          Password&lt;/label&gt;
                      &lt;input id="Password" name="password" data-bind='value:Password, valueUpdate: "afterkeydown"'  type="password" value="" /&gt;
                      &lt;span data-bind='visible: Password.hasError, text: Password.validationMessage'&gt; &lt;/span&gt;
                  &lt;/div&gt;
                  &lt;div&gt;
                      &lt;label&gt;
                          &amp;nbsp;&lt;/label&gt;
                      &lt;input type="submit" data-bind='click:submit' class="button" value="Login" /&gt;
                  &lt;/div&gt;
              &lt;/fieldset&gt;
          &lt;/div&gt;
  
  my javascript code block is 
  
  
  
      var loginModule = (function () {
      $(document).ready(function () {
  
          var userName = $('input:text[name=username]').val();
          var password = $('input:text[name=password]').val();
          ko.applyBindings(new viewmodel(userName, password));
  
      });
  
      ko.validation.registerExtenders();
      var viewmodel = function (username, password) {
          var that = this;
          that.UserName = ko.observable(username).extend({ required: "User Id required", minLength: 5, maxLength: 10 });
          that.Password = ko.observable(password).extend({ required: "Password required" });
  
          that.valid = ko.validatedObservable(that);
          that.submit = function () {
  
          //trying to check user name is valid or not
              alert(that.UserName.isValid());
  
          };
      };
  
      return {
          viewmodel: viewmodel
      }
  })();
  </code></pre>
  
  <p>when user clicks submit button i want to validate by checking isValid() method.</p>