-
-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JS-evaluation in ajax-enabled forms #7203
Comments
I can confirm the issue. |
To fix this we should IMO not evaluate the |
Or may be implement it as a mutation observer instead? |
I would prefer if a solution does not depend on a special widget. |
@asaage The solution will be done within the captcha widget's JavaScript. And any other widget of course needs to implement their JavaScript in a way that is independent from whether the form is submitted via AJAX or not (and that has always been the case). |
i figure, that would probably not solve the original issue i had in mp_forms and complicate enhancing formfield templates with js unneccessary 🤷♂️ |
May be ask on the Contao Community Forum or Community Slack for help regarding that issue.
I am not sure what you mean here. May be also ask on the Contao Community Forum or Community Slack for advice on how to handle forms that are submitted via AJAX properly (this is a general topic unrelated to Contao itself). |
Affected version(s)
5.3.7
Description
When a form is ajax enabled, script-tags are not loaded and executed (exept in the initial page-load).
Not sure, if that is by design, a known limitation or just a missing
eval();
somewhere.It occured first to me in a mp_form but the problem seems to be in the xhr-handler.
Such a script-tag exists especially in the captcha-field/widget (maybe others too).
To recreate: make a form, enable ajax, add an email-field, a captcha-field and a submit. In the FE force a validation error by submitting example@foo (mailaddress without tld). As a result the form will return with the usual errormessage but the captcha-field will be visible and not hidden as usual.
related:
The text was updated successfully, but these errors were encountered: