This is a migrated thread and some comments may be shown as answers.

Functionality Question

5 Answers 103 Views
Validation
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 29 Jun 2012, 02:51 AM
How does the validation "work" in that what happens when I setup validation on a form element.

When you call validate() it loops though all required inputs in that form and runs every rule on each of them?...or does it run on every input in that form.

So then if the rules run per input (seems like this from the demo) can you not setup a global rule that says something like "Count all checked checkboxes on the page and make sure the count is greater than 10"

Does that make sense?

5 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 29 Jun 2012, 11:17 AM
Hi Steve,

Indeed, the validation rules are executed for all of the input elements within the container to which the Kendo Validator is attached.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 29 Jun 2012, 02:19 PM
Ok, followup

1) Just for inputs marked REQURIED (yes right?)
2) Is there no way to set a global rule to just check something once and if it fails, have the validation fail into a summary message?
0
Rosen
Telerik team
answered on 02 Jul 2012, 08:20 AM
Steve,

No, as I have mentioned in my previous message, the validation rules are executed for all of the input elements within the container. If a rule fails for the given input, the remaining rules for this input element are not executed, and the validation process the next input element.

Greetings,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 03 Jul 2012, 02:06 PM
But why would I want a checkbox validation to run for a radiobutton?

What if I wanted to have something that's not "validating an input" but like I said is a larger validation like Select at least 6 of 12 checkboxes.
0
Rosen
Telerik team
answered on 04 Jul 2012, 07:54 AM
Hello Steve,

Our Validator is target through a more granular level (per element) of validation. However, you may achieve such functionality by using similar to the rule demonstrated in this test page.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Validation
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Rosen
Telerik team
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Share this question
or