Skip to content

[Form] Deprecate max_length option #7148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
webmozart opened this issue Feb 21, 2013 · 2 comments
Closed

[Form] Deprecate max_length option #7148

webmozart opened this issue Feb 21, 2013 · 2 comments

Comments

@webmozart
Copy link
Contributor

There is no logic behind the max_length option except for setting the maxlength attribute in the HTML tag. Consequently, the option should be removed and usages changed to:

$builder->add('field', 'text', array(
    'attr' => array('maxlength' => ...),
));
@siboulet
Copy link

Under Symfony 2.3.2 I couldn't get the maximum length for my input field to work using "max_length". In fact setting the "max_length" in my attr array simply added "max_length" to the actual input field attribute. I switched to "maxlength" and it worked. Documentation here needs to be updated: http://symfony.com/doc/current/reference/forms/twig_reference.html#twig-reference-form-variables

@wouterj
Copy link
Member

wouterj commented Feb 19, 2015

This can be closed as it was fixed with #10001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants