﻿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
15924	html5 forms input types, attributes	roman2k9@…	nobody	"Could you add new html5 features in django forms widgets? 
Such as 'email', 'tel', 'url', 'number', and other input types. For Example i solved this problem by writing my own widget like this:


{{{
class EmailInput(Input):
    """"""
    The email input widget
    """"""
    input_type = 'email'

class ContactUsForm(forms.Form):
    sender = forms.EmailField(
        label='',
        widget=EmailInput(attrs={
            'required': '',
            'placeholder': _('Your email'),
            'title': _('Example: my_mail@gmail.com')}),
        required=True)
}}}


This generates HTML:
{{{
<form action=""contact_us/"" id=""contact_us_form"" method=""POST"">
    <input name=""sender"" title=""Example: my_mail@gmail.com"" type=""email"" required="""" placeholder=""Your email"" id=""id_sender""><label for=""id_sender""></label>
</form>
}}}

note that new input attributes such as {{{""reqired""}}} must be render automatically by widget (when i write {{{required=True}}} in Field parameters) whithout instead widget attribute {{{'requred':''}}} (see above)

HTML5 form attributes:
[http://www.w3schools.com/html5/html5_form_attributes.asp]

HTML5 input types:
[http://www.w3schools.com/html5/html5_form_input_types.asp] "	New feature	closed	Forms	1.3	Normal	invalid	forms, html5		Unreviewed	0	0	0	0	0	0
