Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Pressing the return button doesn't work
This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko 1 year, 1 month ago.
- AuthorPosts
- January 25, 2022 at 4:51 am #36377
I’ve set in the setting Action when pressing the return button to trigger live search but it doesn’t work. Only clicking the magnifier icon works.
January 25, 2022 at 10:26 am #36382Hi,
Thank you for the notice.
I checked your configuration, and the triggers are set to activate after 5 characters. The magnifier is actually buggy, as it triggers before the number of characters is entered, that will be corrected in the next release.
If you want to only trigger the search on return/magnifier events, then I recommend this configuration: https://i.imgur.com/GI7q2ma.png
Best,
In that case the plugin will trigger even if there are no characters entered.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 26, 2022 at 4:35 am #36405Thanks. If we don’t want to disable trigger live search when typing but still want people to be able to enter when the search term is less than 5 characters, is it possible to add some kind of script to make the enter work?
January 27, 2022 at 10:04 am #36417Actually, it could be possible.
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.
Best,add_action('wp_footer', 'asp_add_footer_script'); function asp_add_footer_script() { ?> <script> (function($){ $('input.orig').on('keyup', function(e){ if (e.which == 13) { ASP.api(1, 1, 'searchFor', $(this).val()); } }); }(WPD.dom)); </script> <?php }
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.