Environment:
- Joomla 6.1.3 Stable
- SP Page Builder Pro 6.9.1
- Helix Ultimate
- Contact Form addon
- Joomla built-in Proof of Work CAPTCHA enabled
Problem:
The SP Page Builder Contact Form does not submit when Joomla's Proof of Work CAPTCHA is enabled.
Instead of the AJAX request, the browser performs a normal GET request to index.php and reloads the page.
The browser console shows:
Uncaught TypeError: can't access property "includes", t(...).attr(...) is undefined
sppagebuilder.js:1779
The failing code is:
if (t(this).attr('name').includes('sppb-hpt_')) return !0;
The element causing the error is the checkbox generated by the Proof of Work CAPTCHA. It has no "name" attribute, for example:
<input id="custom_captcha_..." type="checkbox" required>
Therefore t(this).attr('name') returns undefined and .includes() throws an exception.
It looks like the form validation code assumes that every input element has a name attribute, which is not true for the checkbox generated by Joomla's Proof of Work CAPTCHA.
Reproduction:
- Create an SP Page Builder Contact Form.
- Select and Enable Joomla's Proof of Work CAPTCHA.
- Open the page.
- The JavaScript exception occurs during page initialization.
- Submit the contact form.
- The AJAX submit handler is not active due to the initalization failure, so the form falls back to a normal GET request to index.php.
Control test:
- Disable Proof of Work CAPTCHA.
- The contact form works correctly.
- AJAX response is successful.
- Recipient receives the email.
Temporary fix:
Changing the line which throws the exception from:
if (t(this).attr('name').includes('sppb-hpt_')) return !0;
to:
if ((t(this).attr('name') || '').includes('sppb-hpt_')) return !0;
fixes the issue.
After this change:
- Proof of Work CAPTCHA remains enabled
- AJAX submission works
- recipient receives the email
- copy to applicant works