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

"multiselect" without search

Home Forums Product Support Forums Ajax Search Pro for WordPress Support "multiselect" without search

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #33785
    lumiest10lumiest10
    Participant

    Hi,

    Is possible the frontend categorie & taxonomy display mode “multiselect” without search.

    I don’t need to enable writing in the search box. In the mobile version it is even annoying since the keyboard is activated.

    Thanks!

    #33789
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Well, it might be possible via a a small custom javascript code.

    Try adding this code to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.

    add_action("wp_footer", "wp_footer_add_asp_script", 9999);
    function wp_footer_add_asp_script() {
    	?>
    	<script>
    	document.querySelectorAll('.asp_select2-search__field').forEach(function(el) {
    		el.disabled = true;
    	});
    	</script>
    	<?php
    }

    This will disable the search input on the multiselect alltogether, if all goes well.

    #33797
    lumiest10lumiest10
    Participant

    You cannot access this content.

    #33803
    Ernest MarcinkoErnest Marcinko
    Keymaster

    The code does not seem to be executed, I can not see it on the site source. I assume that custom code plugin may require a different syntax or some sort of a different configuration.
    If you pleace it to the functions.php file, it will work.

    If the custom code plugin allows putting custom javascript code, then you can paste only the javascript section of it to the snippet:

    	document.querySelectorAll('.asp_select2-search__field').forEach(function(el) {
    		el.disabled = true;
    	});

    Just make sure it is printed to the site footer as the last script tag.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.