Dependencies to define a field required according specific

Hello Developers,

I'm working on sugarCRM 8.3. I need to write dependencies on custom field, where field is required or visible for specific role. I tried using JS but it is working only on web not in mobile.