------forms.py------- class FormName(forms.Form): name = forms.CharField( required=True) email = forms.EmailField( required=True) vmail = forms.EmailField( required=True) text = forms.CharField(widget = forms.Textarea) def clean(value): cleaned_data = super().clean() name = cleaned_data.get("name") email = cleaned_data.get("email") vmail = cleaned_data.get("vmail") if email != vmail: raise ValidationError("Emails are not match") --------views.py----- def forms_web(request): forming = forms.FormName() if request.method == 'POST': forming = forms.FormName(request.POST) if forming.is_valid(): print("VALIDATION SUCCESS!") print("NAME :" +forming.cleaned_data['name']) print("EMAIL :" +forming.cleaned_data['email']) print("VMAIL :" +forming.cleaned_data['vmail']) print("TEXT :" +forming.cleaned_data['text']) return render(request ,'django_App/forms.html',{'form':forming})
email = forms.EmailField( required=True) vmail = forms.EmailField( required=True)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)