﻿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
3578	newforms EmailField takes the wrong max_length when rendered as html and a CharField exists.	Georgi Stanojevski <glisha gmail com>	Allagappan (IRC:vegpuff)	"
If I have a form with CharField and a form with EmailField like bellow. The TextInput widget in the EmailField takes the max_length attribute from the prevous form and displays the input html with a wrong attribute. The validation of the field is OK.

I guess this happens in the TextInput widget, but I can't figure it where on my own to help. 

{{{ 
#!python
from django import newforms as forms
from django.newforms.widgets import *

attrs1={'class':'aclass'}

class form1(forms.Form):
    field1 = forms.CharField(widget=TextInput(attrs=attrs1),max_length=30)

class form2(forms.Form):
    field2 = forms.EmailField(widget=TextInput(attrs=attrs1),max_length=10)

f2 = form2()

f2.as_ul()
Out[12]: u'<li><label for=""id_field2"">Field2:</label> <input id=""id_field2"" type=""text"" class=""aclass"" name=""field2"" maxlength=""30"" /></li>'

f2 = form2({'field2':'over10@domain.com'})

f2.is_valid()
Out[9]: False

In [10]: f2.errors
Out[10]: {'field2': [u'Ensure this value has at most 10 characters.']
}}}"		closed	Forms	dev		fixed			Accepted	1	0	1	1	0	0
