Reply To: Label checkboxes clicable

#13274

Toto98
Participant

Ah ok ! Thanks,

I so much changed your plugin that I'm afraid to need to update the code again 🙁 So I just wrote this little code, maybe that can help someone else 🙂

1°) jQuery

$('.ajaxsearchpro form .asp_custom_f .asp_option').each(function(){
			var cbContainer = $(this);
			$(this).find('.label').click(function(){
				var cbElement = $(cbContainer).find('input[type=checkbox]');
				var cbState = $(cbElement).prop('checked');
				if(cbState == true){
					$(cbElement).prop('checked', false).change();
				}else{
					$(cbElement).prop('checked', true).change();
				}
			});
		});

2°) CSS

.label
{
  cursor: pointer;
}