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 1 year, 8 months ago.
- AuthorPosts
- June 28, 2021 at 6:15 pm #33785
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.June 29, 2021 at 9:44 am #33789Hi,
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 :)
June 29, 2021 at 6:37 pm #33797You cannot access this content.June 30, 2021 at 11:40 am #33803The 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 :)
- AuthorPosts
You must be logged in to reply to this topic.