Here I'm trying to do jQuery class based validation and it works well but it shows wrong output as well. when I click on search button in search field below fields are getting validated. I'm not getting why is it so happening?

Here I'm trying to do jQuery class based validation and it works well but it shows wrong output as well. when I click on search button in search field below fields are getting validated. I'm not getting why is it so happening?

I think you are using JQuery Validated Plugin. So read the documentation to know how specify the number of fields required.
Look this question, maybe could help you: Jquery Validate