solspace / craft-freeform

Freeform for Craft: The most reliable form builder that's ready for wherever your project takes you.
https://docs.solspace.com/craft/freeform/v5/
Other
48 stars 61 forks source link

Form template attributes removed after submission and validation errors #1557

Closed alexmillman23 closed 1 week ago

alexmillman23 commented 1 month ago

What happened?

If I'm rendering a form like:

{{ theFormToRender.render({
   attributes:{
      id: 'theid',
   }
}) }}

on the initial load I will get <form id="theid">

After the form is submitted (non-ajax) and returns back, the id (and all attributes) are stripped.

Errors and Stack Trace (if available)

No response

How can we reproduce this?

  1. Render a form with required fields
  2. Set the attributes and add an ID or any attribute
  3. Submit form without filling out required fields and inspect form for missing attributes

Freeform Edition

Pro

Freeform Version

5.6.3

Craft Version

4.10

When did this issue start?

No response

Previous Freeform Version

No response

seandelaney commented 1 month ago

Hello @alexmillman23

Are you using caching, and refreshing the hash, payload and CSRF token using some JS?

Also are you calling form.registerContext anywhere in your template?

seandelaney commented 1 month ago

@alexmillman23

I can see your full template, including any form related JS ?