Autosuggest Phrases – populate on Tab

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Autosuggest Phrases – populate on Tab

This topic contains 5 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 1 year, 3 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #31439
    mckots87
    mckots87
    Participant

    Hello,

    We would like the autocomplete phrase to complete when the user hits “tab” as most other autocomplete searches work this way.

    Could you please help us understand if this is possible and if not, any suggestions on how we can custom develop this feature?

    Thank you.

    Mike Kotler

    #31447
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Mike,

    You should be able to achieve that with this custom code:

    add_action('wp_footer', 'asp_tab_trigger_right');
    function asp_tab_trigger_right() {
    	?>
    	<script>
    	jQuery(function($){
    		$('input.orig').on('keydown', function(e){
    			var kc = e.which || e.keyCode;
    			if ( kc == 9 ) {
    				e.preventDefault();
    				var ev = jQuery.Event("keyup");
    				ev.which = 39;
    				$(this).trigger(ev);
    			}
    		});
    	});
    	</script>
    	<?php
    }
    Best,
    Ernest Marcinko

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


    #31449
    mckots87
    mckots87
    Participant

    Thank you so much. Can you please just help clarify where I should add this code? Does this go in the functions.php file? Im a very amateur developer.

    Thank you again!

    #31450
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Sure, no problem.

    Yes, optimally into the child theme functions.php file.

    Best,
    Ernest Marcinko

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


    #31452
    mckots87
    mckots87
    Participant

    It worked great! Thank you soooo much!

    #31453
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

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


Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.