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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:52:35+00:00 2026-06-07T08:52:35+00:00

My viewmodel has a ko.observable members that store dialog state objects. Each dialog object

  • 0

My viewmodel has a ko.observable members that store dialog state objects. Each dialog object has all sorts of members corresponding to input fields in a dialog. I would like to add validation to the dialogs using the KnockoutJS validation plugin.

I don’t, however, want to add validation to my entire view model, but rather just to my dialogs. When I tried extending the dialogs like this:

    this.dialog = ko.observable(new RegistrationDialog(self)).extend({validatable: true});

things didn’t work right: the isValid() and errors() methods were not defined, and validation wasn’t working properly. I’ve created a jsfiddle to illustrate this. When I press the start button, the dialog opens (pardon the lack of CSS), but pressing enter doesn’t generate any error messages. email validation also fails to work, showing the message ‘true is not a proper email address.’

  • 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-07T08:52:37+00:00Added an answer on June 7, 2026 at 8:52 am

    I would go with the documentation:

    this.dialog = ko.validatedObservable(new RegistrationDialog(this));
    

    Then fix some bugs in your fiddle:

    • data-blind
    • click handler on the form (instead of submit, I assume)
    • on the register button you have enable: isValid which should be enable: isValid() (I also removed the click binding because of fixing the form submit binding)

    I think that was it. Updated fiddle here

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

Sidebar

Related Questions

I am designing a viewmodel object in knockout that has an observable array. When
So I've got an object that has an observable collection. Most places I bind
I have a window that is databound to a ViewModel. The ViewModel has many
I have a ComboBox that has the SelectedItem bound to the ViewModel. <ComboBox SelectedItem={Binding
My viewmodel has a property called Recipient. That has a Property called MobileNumber I'm
My ViewModel has validation attributes that ensure that it wont be empty etc. -
My ViewModel has a property that is a collection of another of my model
I Have a controller that returns a viewModel. That viewModel has a property called
its said that 1 ViewModel has 1 View. 1 View is for me a
I created a ViewModel which has an observable property. I bind this array to

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.