This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Clear the searchfield content automatically

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Clear the searchfield content automatically Reply To: Clear the searchfield content automatically

#55951
Ernest MarcinkoErnest Marcinko
Keymaster

Hi!

While there is no option for that, but it is possible via a small custom coded snippet:

add_action(
	'wp_footer',
	function () {
		?>
		<script>
			jQuery(function($){
				$('.asp_m input.orig').on('blur', function(){
					$(this).closest('.asp_m').find('input').val('');
				});
			});
		</script>
		<?php
	}
);

Add this code via the Code Snippets plugin (or similar) or 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.