Home Forums WoodMart support forum Search Button in Mobile Menu Bug Reply To: Search Button in Mobile Menu Bug

#71535

rmbaumer
Participant

For now, I have addressed this issue by adding the following code to functions.php which makes the search input a required field:


/**
  *
  * In mobile menu, disable search submit button if search field is empty
  *
  */
add_action('wp_footer', 'rmb_disable_empty_mobile_search');

function rmb_disable_empty_mobile_search(){

?>

<script>
	jQuery(document).ready(function($){
		$('form.searchform input.s').prop('required',true);
	});
</script>

<?php

}

In a future release, it would great if you could just add the property required to the search input itself.

Thanks!