How to get form field's id in Django?
You can get the ID like this:
{{ field.auto_id }}
You can also use id_for_label
:
{{ field.id_for_label }}
This doesn't work for every form field.
For instance {{ form.address.auto_id }}
works while {{ form.address.auto_name }}
will not.
However you can use {{ form.address.html_name }}
to get the equivalent answer.
Here are the docs