Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

at leastone checkbox required jquery

$.validator.addMethod("roles", function(value, elem, param) {
   return $(".roles:checkbox:checked").length > 0;
},"You must select at least one!");

<input class='{roles: true}' name='roles' type='checkbox' value='1' />
  
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to detect click outside div 
Javascript :: js every 
Javascript :: number to float js 
Javascript :: js binary 
Javascript :: process exit code 
Javascript :: document.print js 
Javascript :: use $ instead of jQuery 
Javascript :: How to make HTML input tag only accept numerical values? in jsx 
Javascript :: form submit not reaload 
Javascript :: react iterate over map 
Javascript :: node require fs not found 
Javascript :: jquery api 
Javascript :: unix timestamp js 
Javascript :: axios post request javascript 
Javascript :: sliding window algorithm javascript 
Javascript :: iife in javascript 
Javascript :: js detect if content editable div is empty 
Javascript :: react native text align vertical center 
Javascript :: react-native-google-places-autocomplete only cities 
Javascript :: ternary react 
Javascript :: react useMemo to render a list 
Javascript :: prev props 
Javascript :: how to toggle navbar using javascript 
Javascript :: javascript null check 
Javascript :: fibonacci recursion 
Javascript :: access json object in javascript loop 
Javascript :: local reload go to top 
Javascript :: popup javascript 
Javascript :: js how to calculate factorial 
Javascript :: number pattern js 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =