Skip to content

Instantly share code, notes, and snippets.

@peterbe
Created August 1, 2011 16:13
Show Gist options
  • Save peterbe/1118434 to your computer and use it in GitHub Desktop.
Save peterbe/1118434 to your computer and use it in GitHub Desktop.
EmailInput HTML5 friendly for Django
class EmailInput(forms.widgets.Input):
input_type = 'email'
def render(self, name, value, attrs=None):
if attrs is None:
attrs = {}
attrs.update(dict(autocorrect='off',
autocapitalize='off',
spellcheck='false'))
return super(EmailInput, self).render(name, value, attrs=attrs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment