HEX
Server: LiteSpeed
System: Linux d8 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User: wbwebdes (3015)
PHP: 8.1.31
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/wbwebdes/domains/survey.nailsbyrianne.nl/public_html/assets/scripts/admin/checkgroup.js
(function($){
	$.fn.checkgroup = function(options){
		//merge settings
		settings=$.extend({
			groupSelector:null,
			groupName:'group_name',
			enabledOnly:false
		},options || {});
		
		var ctrl_box=this;

		
		//allow a group selector override option
		var grp_slctr = (settings.groupSelector==null) ? 'input[name='+settings.groupName+']' : settings.groupSelector;
		
		//grab only enabled checkboxes if required
		if(settings.enabledOnly)
		{
			grp_slctr += ':enabled';
		}

		//attach click event to the "check all" checkbox(s)
		ctrl_box.click(function(e){
			chk_val=(e.target.checked);
			$(grp_slctr).attr('checked',chk_val);
			//if there are other "select all" boxes, sync them
			ctrl_box.attr('checked',chk_val);
		});
		//attach click event to checkboxes in the "group"
		$(grp_slctr).click(function(){
			if(!this.checked)
			{
				ctrl_box.attr('checked',false);
			}
			else
			{
				//if # of chkbxes is equal to # of chkbxes that are checked
				if($(grp_slctr).size()==$(grp_slctr+':checked').size()){
					ctrl_box.attr('checked','checked');
				}
			}
		});
		//make this function chainable within jquery
		return this;
	};						
})(jQuery);