I have a text field where user enters an email address. I need to require that if a value is entered the email domain is a certain domain. Sometimes this field is empty so I need to require domain only if a value has been entered. Can this be achieved in javascript?