In our application we have few accordion style sections inside the sections we have few properties as required, some of the sections user may not need to fill or forgot fill and try to submit it shows Error: on top without proper error message. it is confusing the user to know which section to expand and see the error message. How we can avoid this issues ? we want to validate on client side not on server side? How we can achieve same functionality.
You can handle this client side. Assuming you have client side validation turned on (you should as it is the default), and you mark a field required, this will prevent such a scenario under the assumption a user has navigated to said field.
The problem here is that if you hide the field in a collapsed section, then a user would never know there are required fields to be filled out.
Can you consider refactoring your UI so that important fields, especially if they are required to be in either a flat section or by default expanded?
It would honestly server a better UX overall with such an approach.