Hi all,
I have an problem. When I use the django library form, It create an attribute "required" for an input. But when I look on my explorer (firefox or chrome or IE) i have a XML error.
"XML parsing error: malformed".
this is my code :
"
class LoginForm(forms.Form):
email = forms.EmailField(label='Courriel :')
password = forms.CharField(label='Mot de passe :',
widget = forms.PasswordInput)
def clean(self):
cleaned_data = super (LoginForm,self).clean()
email = cleaned_data.get("email")
password = cleaned_data.get("password")
if email and password:
if password != 'bob' or email != 'b...@bob.fr' :
raise forms.ValidationError("Adresse de courriel ou mot de passe erroné.")
return cleaned_data
"
this is my déclaration for XML and doctype :
"
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr"> "
I can put "required=False" and it's OK, but I want that my input is required (required=True it's not OK)
XML don't accept that required attribute is alone, whithout "= someting".
If someone has had this problem?
Django 1.10
Firefox last update