I'm trying to edit the field type in a form that is using the html5
doctype. I've tried two ways:
class AddressForm(ModelForm):
contact_email = forms.TextInput(attrs={'type': 'email'})
and
class AddressForm(ModelForm):
def __init__(self, *args, **kwargs):
super(AddressForm, self).__init__(*args, **kwargs)
self.fields['contact_email'].widget.attrs["type"] = 'email'
Neither works.
Am I looking in the wrong place?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/wpLL-DHz5fQJ.
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-users?hl=en.