﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
4020	USPhoneField, USZipCodeField and USSocialSecurityNumberField should implement HTML maxlength	joe4444	nobody	"For a CharField with max_length=30 it is not necessary to set attrs={'maxlength': '30'} in that form's widget (or set a widget at all in many cases).  However, the fields USPhoneField, USZipCodeField and USSocialSecurityNumberField do not set maxlength=""#"" in the HTML they produce.  In fact, USZipCodeField explicitly sets max_length=None.  Maybe there is a good reason for this, but it seems like these fields could automatically add maxlength=""#"" to their output considering they validate for a specific length and format.

[[BR]]

{{{
    phone = forms.USPhoneField(widget=forms.TextInput(attrs={'maxlength': '12'}))    # a bit verbose
    phone = forms.USPhoneField()    # should be equivalent to the previous line
}}}

[[BR]]

I wish I had a patch for this, but I wouldn't know where to begin."		closed	Forms	dev		wontfix	usphonefield uszipcodefield ussocialsecuritynumberfield		Design decision needed	0	0	0	0	0	0
