A unique value can only be detected by querying the database. This means that you will have to do some hand coding.
In the UI you can use an Ajax call. In the application server (i.e."code behind') you can execute a database query. Finally in the database itself you probably have a unique constraint (unique index) on the particular value you are checking.
This duplication is the nature of validation if you want the user to have a great user-experience.
Hope this helps.
Jack Poorte, Nov 04, 2015