Hello Syed,
Firstly, the field must be client-side enabled. Otherwise, you will not be able to override this functionality.
Second, there are two ways to accomplish what you're looking for once setting the field to client-side required. You can use the TPC API to either disable the field when hidden and enable it when you show it again or set and remove the requirement as well.
ie.
tpc.forms[0].field_developer_name.disable() / tpc.forms[0].field_developer_name.enable()
tpc.forms[0].field_developer_name.required(true) / tpc.forms[0].field_developer_name.required(false)
Let me know if you have any further questions on implementing the above.
Client side API docs:
https://www.crmportalconnector.com/developer-network/documentation/portal-connector-widgets/tpc-client-side-api/mvc-based
All the best,
Brady
TPC Web Developer
Last modified on 07 Dec 2021 14:12 by Brady Ward