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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:01:15+00:00 2026-06-12T03:01:15+00:00

I am using Knockout Validation and have everything working as I wanted. I am

  • 0

I am using Knockout Validation and have everything working as I wanted. I am using it with Twitter Bootstrap and have the proper classes being set when an error is encountered.

With jQuery Validation, I was able to also set classes when a validated element passed validation. For instance, you could turn the input box green when the user had entered valid information.

Is there a way to do that with Knockout Validation? Anyone have an example?

  • 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-12T03:01:16+00:00Added an answer on June 12, 2026 at 3:01 am

    Currently, Knockout-Validation doesn’t support a “validationSuccess” class to be added to an element if a validated value isValid. (But we do take pull requests).

    However, if you simply want to indicate success on an element, you can do something like:

    <input type="text" data-bind="value: lastName, css: { success: lastName.isModified() && lastName.isValid() }"/>
    

    If you want this to be the default behavior, just look at overriding the
    ko.bindingHandlers['validationMessage'] and
    ko.bindingHandlers['validationElement'] functionality.

    I’ve got an example working here (use JSBin in Chrome): http://jsbin.com/miqanineva/2/edit?html,css,js,output

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

Sidebar

Related Questions

How can I do the following validation using knockout js? I have the following
I'm using Knockout.js 2.1.0 and jQuery 1.8. I have 2 nested foreach, this working
I'm using knockout.js and twitter bootstrap's modal plugin to data-bind the user's email address
I am using knockout and have an array Properties and each Property can have
I just started using knockout.js and it works great with normal bidings. I have
I am using Knockout Js for my view page. I have a requirement where
I am using knockout.js to display a list of employees. I have a single
We're using Knockout.js and the Knockout-validation plugin. When a user returns to a page
I'm using knockout.js to build a <select> element's <option> s, and also to set
Html form is controlled using Knockout JS and jQuery templates. Basic jQuery validation is

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.