WordPress.org

Ready to get started?Download WordPress

Forums

Easy Modal
Easy Modal and Checkboxes (2 posts)

  1. benneja1
    Member
    Posted 2 months ago #

    Looking to use easy modal to pop a notification box when a user selects a check box in a form. As it stands now, when they click the check box it pops the modal message but when they close the message the check box remains unchecked.

    Check box setup:
    <nobr><input class="eModal-1" type="checkbox" name="type[]" value="testing" />testing</nobr>

    The site is on a network without internet access so I am unable to provide a link.

    https://wordpress.org/plugins/easy-modal/

  2. danieliser
    Member
    Plugin Author

    Posted 2 months ago #

    Ok so the function that runs when you click a modal link uses e.preventDefault() which as you may have figured out stops the click from doing its default action, such as changing pages etc.

    So the default function of the checkbox isn't fired, so it remains unchecked.

    You can make your own open function and add it to your themes JS or footer to get the desired affect.

    Something like

    jQuery('.eModal-1').click(function(e){
        jQuery('#eModal-1').emodal('open');
    });

    Change the ID of course but that should do it.

    Hope this helps.

Reply

You must log in to post.

About this Plugin

About this Topic