If you have multiple forms
from django import forms
class NameForm(forms.Form):
your_name = forms.CharField(label=\'Your name\', max_length=100)
class Sec
In your view, you can do form.__class__.__name__
but this doesn't work inside a template because django templates do not recognize variables that begin with __
The best thing to do in your case would be to simply create an extra context variable that identifies the form name
id="{{form_name}}_{{field.val}}"