Needs spacing removing and results emptied
-
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>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Needs spacing removing and results emptied’ is closed to new replies.