Search code examples
symfonyconstraintsassertvalidation

Symfony2 - @Assert\Email() changes field height


i'm using @Assert\Email to validate an email field, but it looks like it changes the fields appearence even if it' really doesn't... The css style is still there although somehow for an unknown reason (to me at least) the field looks smaller, in height. Is there anyway to avoid this?

Example:

photo


Solution

  • I ended up using a custom Regex

     @Assert\Regex(pattern="/[a-zA-Z0-9\_\-]+[a-zA-Z0-9\.\_\-]*@([a-zA-Z0-9\_\-]+\.)+([a-zA-Z]{2,4}|travel|museum)$/")