django-crispy-forms / crispy-tailwind

A Tailwind template pack for django-crispy-forms
MIT License
331 stars 56 forks source link

Fix bug in formset_factory form fields #84

Closed io2 closed 3 years ago

io2 commented 3 years ago

When using any of the formset_factorys to generate multiple forms, the select fields lose their values if the form is returned with an error.

This happens because the template renders field.name instead of field.html_name.

field.name is the same for all forms, field.html_name is unique for each form instance

https://github.com/django-crispy-forms/crispy-tailwind/issues/83

Kindly accept my humble contribution to your wonderful project.

smithdc1 commented 3 years ago

Thank you very much for your contribution. 👍