How to check validity of domain in form?