adds form validation for search