at leastone checkbox required jquery

Solutions on MaxInterview for at leastone checkbox required jquery by the best coders in the world

showing results for - "at leastone checkbox required jquery"
Emilia
15 Jan 2018
1$.validator.addMethod("roles", function(value, elem, param) {
2   return $(".roles:checkbox:checked").length > 0;
3},"You must select at least one!");
4
5<input class='{roles: true}' name='roles' type='checkbox' value='1' />
6