I have this model
name = models.CharField(max_length=50, blank=True, null=True)
email = models.EmailField(max_length=50, unique=True)
I wa
Instead of RegexValidator, give validation in forms attributes only like...
class StaffDetailsForm(forms.ModelForm):
first_name = forms.CharField(required=True,widget=forms.TextInput(attrs={'class':'form-control' , 'autocomplete': 'off','pattern':'[A-Za-z ]+', 'title':'Enter Characters Only '}))
and so on...
Else you will have to handle the error in views. It worked for me try this simple method... This will allow users to enter only Alphabets and Spaces only