Label checkboxes clicable

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 6 years, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #13271
    Toto98
    Toto98
    Participant

    Hi,

    I’d like to know how to make the label clickable for the checboxes ? So we can click on labels to check the checkboxes 🙂 Because currently there aren’t 🙁 I saw on your website, when looking for FAQ that you have some checkboxes with this behavior (see attached).

    Thanks in advance for your help
    Thomas

    Attachments:
    You must be logged in to view attached files.
    #13273
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Thomas,

    Make sure to update to the latest release (4.10.4) for that. It’s just been added as a feature, older versions does not support that. This should do the trick.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #13274
    Toto98
    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;
    }
    #13278
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Label checkboxes clicable’ is closed to new replies.