Improved search form validation