Managing external identities to enable secure access for partners, customers, and other non-employees
JavaScript error when submitting signup form after unchecking pre-selected checkbox
I have an optional checkbox in my signup form.
Initially, I pre-selected this checkbox by passing true to the extension attribute during the OnAttributeCollectionStart event. With this setup, the checkbox appears selected by default.
However, when the user unchecks the checkbox and submits the form, a JavaScript error appears in the browser console.
I also tried removing the attribute assignment from the OnAttributeCollectionStart event. In this case:
- The checkbox is not selected by default
Submitting the form without interacting with the checkbox works fine
But if I check the checkbox, then uncheck it, and submit the form, I get the same JavaScript error
So in summary:
Pre-selected checkbox → uncheck → submit → ❌ JavaScript error
Not pre-selected → check → uncheck → submit → ❌ JavaScript error
Not pre-selected → never touched → submit → ✅ works
Has anyone encountered this behavior before? Any idea why toggling the checkbox state (especially from checked to unchecked) causes a JavaScript error on submit?I have an optional checkbox in my signup form.
Initially, I pre-selected this checkbox by passing true to the extension attribute during the OnAttributeCollectionStart event. With this setup, the checkbox appears selected by default.
However, when the user unchecks the checkbox and submits the form, a JavaScript error appears in the browser console.
I also tried removing the attribute assignment from the OnAttributeCollectionStart event. In this case:
The checkbox is not selected by default
Submitting the form without interacting with the checkbox works fine
But if I check the checkbox, then uncheck it, and submit the form, I get the same JavaScript error
So in summary:
Pre-selected checkbox → uncheck → submit → ❌ JavaScript error
Not pre-selected → check → uncheck → submit → ❌ JavaScript error
Not pre-selected → never touched → submit → ✅ works
Has anyone encountered this behavior before?
Any idea why toggling the checkbox state (especially from checked to unchecked) causes a JavaScript error on submit?