This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Label checkboxes clicable

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #13271
    Toto98Toto98
    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

    #13273
    Ernest MarcinkoErnest 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.

    #13274
    Toto98Toto98
    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

    [code]$(‘.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();
    }
    });
    });[/code]

    2°) CSS

    [code].label
    {
    cursor: pointer;
    }[/code]

    #13278
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Label checkboxes clicable’ is closed to new replies.