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

durandal with ko.validation.init

So, here is the problem i have been facing for couple of days. I have a durandal application and i want to apply ko validation on the controls. Now, the validation does get applied but the problem is that it does not take affect at the first load.…
user1662008
  • 297
  • 1
  • 5
  • 17
0
votes
1 answer

Loop over just properties not functions in knockout model

I am trying to validate my model manually by calling self.isModelvalid in my test and assuming that I would return true , because before calling it I assigned test values to all properties in my model . here is how I call in my test …
Ancient
  • 3,007
  • 14
  • 55
  • 104
0
votes
1 answer

knockoutjs validate multiple forms

i have three forms in my web
// fields
andrescabana86
  • 1,778
  • 8
  • 30
  • 56
0
votes
0 answers

How to get failed validation rule?

I'm using knockout validation plugin. I have a few validation rules for my observable. Is it possible to define which rule failed during the validation? I tried to use method rules(), but it just returns list of the attached rules, but not a state…
Pylyp Lebediev
  • 1,991
  • 4
  • 26
  • 44
0
votes
1 answer

Knockout validation Issuue

function ProductViewModel() { var self = this; self.Amount= ko.observable(0); self.Quantity= ko.observable(0); } ko.extenders.numeric = function(target, precision) { var result = ko.computed({ read: target, write: function(newValue) { …
Nilesh Moradiya
  • 691
  • 1
  • 10
  • 19
0
votes
2 answers

Knockout js validation plugin issues when validating an observableArray of observables

I have an observable array of observables - each observable has been extended for require however when i save the form with cleared fields it does not collect error or have any errors to show - ko.validation.configure({ grouping: { deep:…
0
votes
1 answer

KnockoutJS Validation|Mapping Custom message does not work

I create a simple model from mapping with knowkoutjs and I want to validate it. Even if I specify the validation message, the default message is still displayed. ko.validation.configure({ parseInputAttributes: true }); var data = { name: "Joe…
Yooz
  • 2,506
  • 21
  • 31
0
votes
1 answer

knockout validation with typeahead combobox plugin

I am trying to use Knockout Validation in combination with Bootstrap Combobox Plugin. I have a select control that is bound to my observable property which has the required attribute (for KO Validation). The user can enter any value in the text input, but I'd only want the binding to occur in my model if the value is within a…
RullDawg
  • 211
  • 1
  • 2
  • 14
0
votes
1 answer

KnockoutJs & Asp.Net MVC 4 - multi model views Submit

I am in a situation where I have 2 tabs and for each tab I have a partial views, I am using jquery UI to create my tabs. I have two options for each user 1. to save, 2. to submit. On save it will save for that particular tab ( where the tab contains…
0
votes
1 answer

Knockout Validation on Breeze.js entities

I'm trying to get Knockout Validation running on my Breeze.js entities but not having much luck. So currently I'm just trying to get a very basic test working to confirm the approach should work but am stumped as to why this is not even working. …
mutex
  • 7,536
  • 8
  • 45
  • 66
0
votes
1 answer

Custom Knockout Validation Rules with TypeScript

This is very similar to another question I have active, but may as well ask it as its different and may be found useful by a different audience. I have a custom rule for knockout validation: ko.validation.rules["sameAs"] = { validator: function…
Grofit
  • 17,693
  • 24
  • 96
  • 176
0
votes
1 answer

Knockout validation of my properties in my model

I try to add knockout validation on my page. I see an example here: How to use ko.validation.group function But my code is somewhat different, see below: define(function (require) { var datacontext = require('services/datacontext'), app =…
Bronzato
  • 9,438
  • 29
  • 120
  • 212