• Resolved Diablo2

    (@diablo2)


    Hi author, i hope you’re doing well!

    I have a quick question – which i brought up a few months ago but I never really looked into….

    Basically, pressing the “Enter” key doesn’t bring up results. People have to actually click the “Search” button.

    – I tried it both on Chrome and on Firefox.
    – I also tried it on 2 different websites.
    – I am on the latest WP version.
    – PHP version 5.4.40

    Website #1: Search for “marketing” or “social media”
    https://listiller.com/advanced-search/

    Website #2: Search for “income” or “seo”
    https://www.epicpassiveincome.com/search/

    What do you think could be causing this? Do you think there could be an option in the plugin that im not configuring properly? Does it work for you on your own website?

    Any advice is highly appreciated!

    https://www.ads-software.com/plugins/ultimate-wp-query-search-filter/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author TC.K

    (@wp_dummy)

    Yes, this is a bug.

    For the moment, you can fix it with this:

    add_action('wp_footer', 'fix_enter_js');
    function fix_enter_js(){
    	?>
    		<script>
    	jQuery(function($) {
    
    		$('body').on('keypress','.uwpqsftext',function(e) { console.log($(this))
    			if(e.keyCode == 13){
    			var form = $(this).parent().parent().attr('id');
    			$('#'+form).submit();
    		}
    		});
    
    	});//end of script
    	</script>
    	<?php
    }

    Thread Starter Diablo2

    (@diablo2)

    Thank you for the quick reply.

    Sorry my development skills are non-existent. Do you mind telling me exactly where to drop this code? Also, can i drop it into any spot (the beginning, middle, or at the bottom of the file?)

    Thanks so much.

    Plugin Author TC.K

    (@wp_dummy)

    Add it to your themes’s functions.php. It doesn’t matter where you insert it. As long as it is in <?php ?> . To avoid confusion, just put it after the <?php at the beginning of the file.

    Thread Starter Diablo2

    (@diablo2)

    Works like a charm, thanks so much!!

    – Elvis

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Pressing Enter Key Does Not Execute Search’ is closed to new replies.