I have a group of checkboxes that I need to validate that at least 1 of them is selected. How do I go about doing this?
Code:
Thanks to anyone that can help me out on this.
Code:
<
div
class
=
"row-fluid"
>
<
span
class
=
"span3"
>
<
input
type
=
"checkbox"
value
=
"abc"
/>abc
</
span
>
<
span
class
=
"span3"
>
<
input
type
=
"checkbox"
value
=
"def"
/>def
</
span
>
<
span
class
=
"span3"
>
<
input
type
=
"checkbox"
value
=
"hij"
/>hij
</
span
>
</
div
>
<
div
class
=
"row-fluid"
id
=
"button-bar"
>
<
button
>Submit</
button
>
</
div
>
var validator = $('.row-fluid').kendoValidator().data('kendoValidator');
$('#button-bar').on('click', 'button', function(e) {
if (!validator.validate()) {
alert("Failed");
return;
}
alert("Passed");
});