I'm following this tutorial http://symfony.com/doc/current/book/forms.html#adding-validation
And added this to my form:
$builder->add('email', null, array('label' => 'userType.label.email','constraints' => array(new Email())));
This works perfectly fine.
But the following does not work:
$builder->add('phoneNumber', null, array('label' => 'userType.label.phoneNumber','required' => true,'constraints' => array(new Type(array('type' => 'numeric')))));
How can i check if the input is numeric, right in the form?