Pressing the return button doesn't work

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 Ernest Marcinko 3 months, 4 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #36377
    apbalice71
    apbalice71
    Participant

    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.

    #36382
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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
    In that case the plugin will trigger even if there are no characters entered.

    Best,
    Ernest Marcinko

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


    #36405
    apbalice71
    apbalice71
    Participant

    Thanks. 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?

    #36417
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Actually, 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.

    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
    }
    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.