Ticket #675: password_field.diff

File password_field.diff, 998 bytes (added by seancazzell@…, 19 years ago)

small patch (from svn diff) that fixes ticket #675

  • django/core/formfields.py

     
    247247
    248248class PasswordField(TextField):
    249249    def render(self, data):
     250        maxlength = ''
     251        if self.maxlength:
     252            maxlength = 'maxlength="%s" ' % self.maxlength
    250253        # value is always blank because we never want to redisplay it
    251         return '<input type="password" id="%s" class="v%s%s" name="%s" value="" />' % \
     254        return '<input type="password" id="%s" class="v%s%s" name="%s" size="%s" value="" %s/>' % \
    252255            (FORM_FIELD_ID_PREFIX + self.field_name, self.__class__.__name__, self.is_required and ' required' or '',
    253             self.field_name)
     256            self.field_name, self.length, maxlength)
    254257
    255258class LargeTextField(TextField):
    256259    def __init__(self, field_name, rows=10, cols=40, is_required=False, validator_list=[], maxlength=None):
Back to Top