Custom Validation

Hi to all,
i need to valide to fields toghtther.

Example in Lead Module:

I would like to prompt users that they have to fill one of:
-> Title
-> Department

So if nothing is filled a prompt must comes to force user to add one of this(OR)

And…

also both Name and Salutation is required(AND)
Thank you for pointing me on the right way…

Hello,

Go through this

It may help you

Good,
i will try …

Thank you

I found this one which is probably the best option:

https://gunnicom.wordpress.com/2015/09/21/suitecrm-sugarcrm-6-5-add-custom-javascript-field-validation/

But i need more explanation … Could you help me

Thank you