Local Amenities Checkbox

  • Jat
    Jat
    Newbie 6 points
    May 9, 2019 at 6:12 pm

    Hi all,

    does anyone know of or have any custom code so that the check boxes in the ‘Local Amenities’ remains UNCHECKED as default?

    @JamesD – i heard you might be able to help!

    Thanks,

    Jat

  • JamesD
    JamesD
    Super Guru 1,401 points
    May 9, 2019 at 9:20 pm

    Hello Jat,

    does anyone know of or have any custom code so that the check boxes in the ‘Local Amenities’ remains UNCHECKED as default?

    Try placing this with your custom javascript:
    jQuery('#form-row-rapper-amenities input[type="checkbox"]').trigger('click');
    Note: This is for the v9 theme.

  • Jat
    Jat
    Newbie 6 points
    May 10, 2019 at 6:15 pm

    Thank you JamesD!

    Where is the ‘custom javascript’ please?

  • JamesD
    JamesD
    Super Guru 1,401 points
    May 10, 2019 at 6:23 pm

    @Jat
    Try placing this in your _functions.php file:

    add_action( 'wp_footer', 'load_footerjs' );
    function load_footerjs() {
        ?>
    <script type="text/javascript">
    <!--
    jQuery('#form-row-rapper-amenities input[type="checkbox"]').trigger('click');
    //-->
    </script>
    <?php } ?>
  • Jat
    Jat
    Newbie 6 points
    May 10, 2019 at 6:34 pm

    That works, but i’m left with a very tall ‘Add Listing button’!

    See: https://test1.solihulllife.com/add-listing/

    I’m running WP 5.2 too

  • Jat
    Jat
    Newbie 6 points
    May 10, 2019 at 7:10 pm

    Any thoughts @JamesD?

  • JamesD
    JamesD
    Super Guru 1,401 points
    May 10, 2019 at 7:26 pm

    @Jat
    No clue what you’re experiencing.
    Account is required to view the link you provided.

  • JamesD
    JamesD
    Super Guru 1,401 points
    May 10, 2019 at 7:54 pm

    @Jat
    I just upgraded to WP 5.2 and it still works the same for me.
    Sounds like there may be a typo/overlap or something going on.

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

New Business Themes for WordPress 2020

Build your WordPress Business today with our WordPress Business themes.