Questions tagged [knockout-validation]

A plugin for knockout.js for declarative, rule-based validation of models and properties.

Knockout Validation allows for validation of knockout.js view model observables through extenders with:

The plugin also supports Asynchronous Validation.

Examples of such extensions include:

var myValue = ko.observable().extend({ required: true });
var myValue = ko.observable().extend({ max: 10 });
513 questions
0
votes
2 answers

Knockout JS Validation to existing view model

This is my current code unmodified: http://jsfiddle.net/XABtF/ I am currently using both jQuery Validation & Knockout Validation I have read through the documentation on both and tried implementing them to my existing script, both haven't ran…
Stephen
  • 707
  • 3
  • 13
  • 33
0
votes
1 answer

How to get one of observable field's validation result in the computed field using Knockout Validation framework

i have a view model defined following: var ViewModel = function() { var self = this; self.name = ko.observable().extend({ required: true }); self.identityCode = ko.observable().extend({ required: true, maxLength: 18, minLength: 15 }); …
czclk
  • 157
  • 1
  • 6
0
votes
1 answer

How to get the observable property's value in the computed property in Knockout-Validation

I use the Knockout-Validation framework to validate the viewModel. I have a viewmodel defined following: ko.validation.init({ decorateElement:true, errorElementClass: 'invalid', insertMessages: false }); var viewModel =…
0
votes
1 answer

How to use knockoutjs with a dropdown from server

from server I get either an A or a B or a G for type What I want it to show is a drop down of a text Gamma if it is G and Alpha if it is A and Beta if it is B. Also that item to be selected ... Not sure how to do this. Here is what I get from my…
0
votes
1 answer

Knockout Validation Firing on Initial Load

We are currently working on a razor application using knockout 2.1. We have started using the knockout validation library. The issue is that the ko validations are being fired on the initial load of the popup. What are we missing here - maybe on the…
Jatin Dua
  • 9
  • 2
0
votes
1 answer

knockoutjs validation async ajax always getting invalid

i am using knockout validation plugin and i am not getting how can i verify that validation is true or false ko.validation.rules['remote'] = { async: true, validator: function ( val, parms, callback ) { var defaults = { …
Anil Gupta
  • 2,329
  • 4
  • 24
  • 30
0
votes
1 answer

ko.bindingHandlers.validationCore.init doesn't work

I am trying to a custom binding to input as datepicker: CODE HERE: http://sdrv.ms/Xc5HZw I have the following code in place but the validation doesn't highlight the control when its invalid: ko.bindingHandlers.datepicker = { init: function…
jmogera
  • 1,689
  • 3
  • 30
  • 65
0
votes
1 answer

Knockout Validation on a dynamic form

I've got a form with fields that are made visible based on some conditions (not relevant here). What happens is that I want to have validation on the fields based on their visibility. So far, I haven't managed to change or disable a rule (such as…
Arnaud
  • 58
  • 5
0
votes
1 answer

Knockout Validation: Unexpected behavior when using collections of validatedObservables

I'm seeing unexpected behavior when attempting to validate a view model comprised of collections of validatedObservable objects; actually, nested collections. First, let me point you to my JSFiddle that demonstrates the behavior:…
CBono
  • 3,803
  • 1
  • 32
  • 40
0
votes
1 answer

knockout validation - advanced search user interface

I am building an advanced search UI similar to the TFS query builder web interface. Using knockout for the client side implementation and have everything more or less working except the final validation to make certain required items are basically…
Steve
  • 78
  • 3
0
votes
2 answers

Knockout Validation viewmodel binding not showing correct errors

Updated to show a working sample with suggested changes which was changing my viewModel to be a validatedObservable per Thewads advice. Took quite a while to get things flowing but its now showing the correct error count!
0
votes
2 answers

Knockout.JS validation and computing off only validated fields

I'm beginning to play with Knockout.JS and I'm trying to compute a sum of 'points' across valid fields in my viewmodel, but have no idea how to go about this. The idea is that as the form is filled I can display a smart progress bar based on the…
Jonathan
  • 419
  • 6
  • 15
0
votes
1 answer

knockout validation- how to ensure unique value in table column and increament by 1 without gap

I want to place knockout validation for my html column "Step No" to ensure value should be unique and increament without gaps from 1 to total number of Steps. example html: …
0
votes
0 answers

Knockout-Validation plugin with typeaheads

I am currently using the validation plugin from https://github.com/ericmbarnard/Knockout-Validation and it is working nicely on plain value fields such as input boxes, but I can not get any validation messages to appear on typeahead fields. The…
Thewads
  • 4,953
  • 11
  • 55
  • 71
0
votes
1 answer

ko.validation.group not recognized

This is the line i am facing problem with : viewModel.errors = ko.validation.group(viewModel); It is showing error: Uncaught TypeError: Cannot read property 'group' of undefined any of the ko.validation.* is not recognized I am Using…
ravikant
  • 67
  • 1
  • 1
  • 11