Initial commit
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
from django import forms
|
||||
|
||||
|
||||
class ContactForm(forms.Form):
|
||||
name = forms.CharField(max_length=100)
|
||||
email = forms.EmailField()
|
||||
subject = forms.CharField(max_length=160)
|
||||
message = forms.CharField(max_length=4000, widget=forms.Textarea)
|
||||
website = forms.CharField(required=False, widget=forms.HiddenInput)
|
||||
|
||||
def clean_website(self):
|
||||
value = self.cleaned_data.get("website", "")
|
||||
if value:
|
||||
raise forms.ValidationError("Invalid submission.")
|
||||
return value
|
||||
Reference in New Issue
Block a user