In order to prevent Users from performing a search without providing any criteria (or only one of the two), I've implemented this hook (which Christian helped me with originally):-
This works well and I'm looking to implement a similar approach for another Search which uses a taxonomy and a Types custom field but having an issue with the hook not working and allowing a search even if the postcode field is empty. The URL on the search results page contains 'wpv-wpcf-postcode' so I'm not sure why the hook isn't working.
Ok - I need problem URL and access details to check why its not working.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
I checked on this page and I tried to search without adding post code and it redirected me to result page. Do you mean that you want that user should not be able to search until he add the postcode on the following page?
=> hidden link
If above is true - you need to add some custom jQuery/javascript code where you should enable/disable the search button until all input/search filters are filled.
I'm trying to avoid using jquery/js (for various reasons). Since it's possible to target the taxonomy fields as in the search I'm already using, surely it's also possible to also target a types custom field?