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
1 answer

Knockout-Validations vs jQuery-Validations

I am developing an ASP.Net WebAPI project and using Knockout.js for client-side MVVM. I was considering about client-side validations now and found out Knockout-Validations. Since this is a recommended validation framework from Microsoft also, I am…
0
votes
1 answer

issue with custom validation rule for duplicate entry in array

I am trying to use knockout.validation plugin. I want created a custom validation rule for checking the duplicate array item while making entry in the array. I tried this : ko.validation.rules['duplicate'] = { validator: function (val1, val2)…
Tom Rider
  • 2,747
  • 7
  • 42
  • 65
0
votes
0 answers

How to trigger a validation to happen in knockout

I'm developing an application which schedules a job. Now, I have radio buttons for Monthly, Weekly, Daily and for specific days. Now, if the user selects the last radio button, I show checkboxes for all days(Sunday, Monday...). I have put knockout…
Feroz
  • 351
  • 1
  • 5
  • 20
0
votes
1 answer

KnockoutJS relation between observable and data-bind

I Have viewModel var viewModel = { amount: ko.observable(1), rate: ko.observable(2), rate222: ko.observable(2) }; How do I know that rate222 not bind on this…
zoh
  • 175
  • 3
  • 13
0
votes
1 answer

Knockout validation pattern throwing error on everything

I added the knockout validation however it seems its throwing everything I put in the field: a,1,?, etc -- only thing works is having the field empty. I'm using the ko validation library and am extending it by using the pattern rule. The ko…
Rob Koch
  • 1,523
  • 3
  • 18
  • 26
0
votes
1 answer

knockout validation with custom validator only fires once

Im using a knockout validation to create a custom validator and am trying us it with a viewmodel created with the knockout mapping plugin. The validation fires the first time I run the code but not when I click save or change a value in the…
Dave
  • 3,812
  • 5
  • 31
  • 39
0
votes
1 answer

knockout-validation custom error message for pattern validator using html5 syntax

I'm using the HTML5 syntax of knockout-validation to validate that the user has entered a valid number like this: It works great, but the error message just says 'Invalid!'. Is…
RussGove
  • 322
  • 5
  • 18
0
votes
2 answers

How to explicitly validate a knockoutJs observable

I'm using KnoockoutJS and the validation plugin from here, https://github.com/ericmbarnard/Knockout-Validation. By default, validation messages only appear after a field has been modified. The problem is that when the user clicks "Save", I need to…
Kye
  • 5,919
  • 10
  • 49
  • 84
-1
votes
2 answers

Knockout validate for empty field not working on button click

I have a simple form which has email & Checkbox which is being validated by knockout, using below code form only validate checkbox but the the email fields if its left empty. Using Extend method it validates email only when we click inside email…
Learning
  • 19,469
  • 39
  • 180
  • 373
-1
votes
1 answer

Knockout Uncaught RangeError: Maximum call stack size exceeded

I'm using Knockout Validation and when I post the view model to the controller I'm getting the exception "Uncaught RangeError: Maximum call stack size exceeded". I have one Main View Model because I'm using the CustomerViewModel in the same view (2…
-1
votes
1 answer

Trigger validation on click on a button in knockout js

I have a form which use KOJs for calculation, I need to implement kojs validation there so that the user should n't submit a blank field in form.. I already tried various resources but they was not very helpful. Please can you guys solve this…
codersrb
  • 140
  • 1
  • 12
-1
votes
1 answer

Show ko.validation error message in bootstrap popover

Already have experience using bootstrap popovers with separate div's... also have expience with ko.validation with native and custom validation rules but in input group text have unspected apereance:
-1
votes
1 answer

need to focus on the first control in DOM Tree which has error, using knockout-validation

I am validating an HTML using knockout-validation, I need to focus the cursor on the first control having error how could I do that? Please help.. Thanks
Animesh
  • 323
  • 3
  • 19
-1
votes
1 answer

knockout subscribe doesn't work when using knockout.validation and knockout.mapping with require.js

So I test this out and found out that the subscribe function never gets called when I set up my code this way: app.index.js requirejs.config({ "baseUrl": "/Scripts/app/item/", "paths": { "jquery":…
-1
votes
1 answer

How to tie together ko.validation errors in UI

I have a small issues while binding erros to UI page using knockou binding. Please help me var searchObj = { model defination } if (!ko.validatedObservable(searchObj).isValid()) { ko.validation.group(searchObj); …
1 2 3
34
35