-
Notifications
You must be signed in to change notification settings - Fork 189
Description
Hi,
i'm trying to get https://github.com/599media/fnn_powermail_altcha running for a local-only captcha solution.
Unfortunately, the JS validation fails since the initially created altcha checkbox-field does not have a name attribute.
When the checkbox is clicked, it is removed and a hidden field with a name attribute is created, then the validation works.
So when nothing is entered in the form and i hit the submit button, the js validation throws an error, the form is submitted, the server validation kicks in and i see an error in the JS console
Form.min.js?1726555609:1 Uncaught TypeError: Cannot read properties of null (reading 'replace')
which seems to track down to
powermail/Resources/Private/Build/JavaScript/FormValidation.js
Lines 484 to 487 in e562bcf
| #getFieldIdentifier(field) { | |
| let name = field.getAttribute('name'); | |
| return name.replace(/[^\w\s]/gi, ''); | |
| }; |
See also 599media/fnn_powermail_altcha#4
Maybe the JS validation should ignore fields in the form that have no name attribute?
I tried setting data-powermail-validation="disabled" to the altcha web component, but it seems like arbitrary data attributes are not supported
I'm currently on TYPO3 11.5 with powermail 10.9, but the code does not seem to have changed in that area