"multiselect" without search

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

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

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

    Attachments:
    You must be logged in to view attached files.
    #33789
    Ernest Marcinko
    Ernest 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.

    Best,
    Ernest Marcinko

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


    #33797
    lumiest10
    lumiest10
    Participant
    You cannot access this content.
    #33803
    Ernest Marcinko
    Ernest 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.

    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)

You must be logged in to reply to this topic.