How to give validation for existing name or existing phone no?

Hi,
In my module capturing information company name and company registration id. I want to validate both fields already exists or not.
How to give validation for this. Please give your suggestion as soon as possible.

Hi,
Please find given link to validate the existing account name or some other fields,

 http://stackoverflow.com/questions/23340660/prevent-duplicate-value-using-ajax-in-sugar-crm