• Resolved jammy to go

    (@jammy-to-go)


    Works fine until you empty the box or input blank spaces.

    I have changed the javascript to get around this…

    <script>
          jQuery('#my-s').keyup(function() {
    		  /* 1. TRIMS THE SUBMITTED VALUE LEFT AND RIGHT AND IS ANYTHING OTHER THAN BLANK */
    		  if (jQuery.trim(jQuery("#my-s").val()) != '')
    		  {
    			jQuery.ajax({
    			  'type':   'get',
    			  'url' :   '<?php echo $plugin_url.'ajax/simple-search.php'; ?>',
    			  'data':   's=' + jQuery.trim(jQuery('#my-s').val()),
    			  'success': function (result) {
    				jQuery('#results').html(result);
    			  }
    			})
    		  }
    		  else
    		  {
    		  	/* 2. CLEARS THE RESULTS BOX
    			ONLY NEEDED IF YOU DELETE THE VALUES IN THE SEARCH BOX TO MAKE IT EMPTY */
    			jQuery('#results').html('');
    		  }
          })
        </script>

    https://wordpress.org/plugins/ajax-search/

Viewing 1 replies (of 1 total)
  • Plugin Author Sandor Kovacs

    (@almos20)

    Hi,

    Thanks for your suggestion. I’ve added your code and new things to version 1.2.0 .

    Best Regards,
    Sandor

Viewing 1 replies (of 1 total)
  • The topic ‘Needs spacing removing and results emptied’ is closed to new replies.