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
3 answers

How to use '&' in if condition with in Virtual element knockout?

I want to implement the virtual element like but it does not executed. Please help me for it.
0
votes
1 answer

Knockout Validation automatically displaying error message before user has entered any data

I'm trying to implement Knockout Validation and Knockout Mapping. I have an ASP.Net MVC WebAPI that sends JSON data to my client where I'm mapping JSON to observables in my model: ViewModel: ko.validation.rules.pattern.message =…
0
votes
2 answers

Counting knockout validation error messages in a public function

I have a jsFiddle here: There is an array in knockout viewmodel and every array element raises an error. Is there a way to count number of error messages for the whole view model and access it by a public javascript function? The idea here is to…
Nexus23
  • 6,195
  • 9
  • 50
  • 67
0
votes
0 answers

knockout validation - how to avoid validation on start?

I have asp.net mvc project where I use knockout.js and knockout validation. The problem is: the validation starts working even before the user can potentially make any action, e.g.: for example I have a field FirstName which is marked as…
Jack Smith
  • 51
  • 1
  • 5
0
votes
1 answer

knockout validation secondary error messages not showing

I have my jsfiddle here: The problem is that the required field messages are showing when we hover over the "*" template, but when we entered invalid characters in the input box, the error message still remains one of required field rather Invalid…
Nexus23
  • 6,195
  • 9
  • 50
  • 67
0
votes
1 answer

Knockout validation inside Bootstrap Modal

For my view; I have a simple textbox as below. in the viewmodel, I have observable defined as dummyValidationTest = ko.observable().extend({ required: true }); Finally, I apply…
0
votes
1 answer

Knockout Validation on existing view model

I would like to ask you can I add knockout validation to a whole model, not to each property. I create a view model using this code: var UserViewModel = function() { return @Html.Raw(Json.Encode(Model.UserViewModel)); }; var…
mardok
  • 2,135
  • 2
  • 23
  • 37
0
votes
1 answer

bootstrap-wysihtml5 knockout.validation

I am trying to set up knockout validation for a wysihtml5 control. Currently I have following code: