I have tried to get an input with the type "number" for the HTML5 frontend support.
My form class:
class MyType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('a', NumberType::class); // i want <input type="number" ...>
$builder->add('b', EmailType::class); // <input type="email" ...> works
$builder->add('c', TextareaType::class);
}
}
The NumberType does not produce an <input type="number"> tag in the twig template with {{ form(myForm) }} like the EmailType <input type="email">.
I couldn't find an option to set the required html attribute value. 'attr' settings does not change it.
I'm using Symfony 3.
kr sebastian