#4020: USPhoneField, USZipCodeField and USSocialSecurityNumberField should
implement HTML maxlength
-----------------------+----------------------------------------------------
Reporter: joe4444 | Owner: adrian
Status: new | Component: django.newforms
Version: SVN | Keywords: usphonefield uszipcodefield
ussocialsecuritynumberfield
Stage: Unreviewed | Has_patch: 0
-----------------------+----------------------------------------------------
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.
--
Ticket URL: <http://code.djangoproject.com/ticket/4020>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---