On https://www.rheinparkcenter-neuss.de/newsletter-registration/, the current integration sometimes logs a generated captcha solution but the final POST request does not include it.
Root cause is the custom click-based orchestration around KROT.getSolution() plus KROT.interceptForm(form, true).
Current code:
- intercepts button click instead of stable form submit semantics
- adds/removes click handlers recursively
- uses
e.interceptedon a transient event object - passes
truetoKROT.interceptForm(form, true)which disables SDK-native interception
This makes submission race-prone and can skip token propagation in certain submit paths (Enter key, alternate submit triggers, timing races).
Use SDK-native interception only:
- call
KROT.interceptForm(form)(without second argument) - remove custom click/re-click flow
- let SDK populate
.captcha_at_hidden_fieldand submit
Use: docs/rheinparkcenter-neuss-captcha-fix.js
In the page template where this block currently exists:
KROT.interceptForm(form, true);
function btnClickHandler(e) { ... }
btn.addEventListener('click', btnClickHandler);replace it with the content from rheinparkcenter-neuss-captcha-fix.js.
The SDK already implements robust form interception:
- blocks submit
- computes solution
- writes hidden field
- re-submits via form submit
Duplicating this logic in custom click handlers introduces intermittent failures.
After deployment, verify:
- click submit with mouse → POST contains
captcha_at_solution - press Enter in form field → POST contains
captcha_at_solution - repeated submits do not duplicate handlers
- no endless "Validation Running..." state
Use ?cpt_debug=true and inspect:
- challenge response received
- solution generated
- hidden field
.captcha_at_hidden_fieldnon-empty before submit
If external sharing is needed as a gist, copy both this README and JS file into a GitHub gist.