Kendo validation fails but has no errors

Viewed 328

I have a form that has been using kendo validate before being submitted to my controller and has been working fine. Then I changed a checkbox to a toggle by adding a class "lc_switch" along with a third party .js/.css (https://github.com/LCweb-ita/LC-switch).

Now it is failing kendo's validation, but it doesn't seem to be returning any errors. Any idea how to see why it's failing validation?

Relevant MVC Code: @(Html.CheckBoxFor(m=>m.MyField, new { @class = "lcs_check" }))

JS:

var validator = $("#myForm").kendoValidator().data("kendoValidator");
 if (validator.validate()) {...}

Thing's I've tried that haven't worked:

validator.errors() (result=[])

validation summary, resulted in undefined (https://docs.telerik.com/kendo-ui/controls/editors/validator/validation-summary)

a different variation of .errors (https://www.telerik.com/forums/validationsummary-properties-usint-kendovalidator)

Current workaround: if (validator.validate() || validator.errors().length === 0 )

I also find it odd that the "on"/"true" position passes validator.validate() but the "off"/"false" position doesn't.

0 Answers
Related