If we have multiple forms on a same page, the first one will always be ok. However, the subsequent ones won't have the same correct formatting once we try to submit them. The default templating we use for our forms is "Bootstrap 5". This is also the same one we use for every form we have created on our website.
For example, if we try to send a form with empty required fields, we expect the class is-invalid to be added to the incorrect fields. Right now, it is the case only on the first form, but not on the other ones (which are all setup the same way and using the same rendering twig template). It is not the only problematic class. It looks like the validated form looses its Bootstrap formatting overrides.
We've tried to fix this by overriding the render method to manually add the error class to no avail. Something odd is that if we look into the Network tab, the response object has the expected classes in its html property.
We've been using Freeform for a couple of years already, and we didn't have problem with the default framework formatting before. We've tested with the different versions, and those before 5.6.0 don't have this bug. It seems like something has changed in the 5.6.0 version.
Errors and Stack Trace (if available)
No response
How can we reproduce this?
Add multiple forms with the Bootstrap 5 templating on the same page
Try to submit the forms with invalid/empty fields
The first form will have the is-invalid class on its invalid fields and the other forms will have the freeform-has-errors class on its invalid fields.
What happened?
If we have multiple forms on a same page, the first one will always be ok. However, the subsequent ones won't have the same correct formatting once we try to submit them. The default templating we use for our forms is "Bootstrap 5". This is also the same one we use for every form we have created on our website.
For example, if we try to send a form with empty required fields, we expect the class
is-invalid
to be added to the incorrect fields. Right now, it is the case only on the first form, but not on the other ones (which are all setup the same way and using the same rendering twig template). It is not the only problematic class. It looks like the validated form looses its Bootstrap formatting overrides.We've tried to fix this by overriding the
render
method to manually add the errorclass
to no avail. Something odd is that if we look into the Network tab, theresponse
object has the expected classes in itshtml
property.We've been using Freeform for a couple of years already, and we didn't have problem with the default framework formatting before. We've tested with the different versions, and those before 5.6.0 don't have this bug. It seems like something has changed in the 5.6.0 version.
Errors and Stack Trace (if available)
No response
How can we reproduce this?
Bootstrap 5
templating on the same pageis-invalid
class on its invalid fields and the other forms will have thefreeform-has-errors
class on its invalid fields.Freeform Edition
Pro
Freeform Version
5.6.4
Craft Version
5.4.9
When did this issue start?
After upgrading from older Freeform version
Previous Freeform Version
5.5.10