-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
Add a confirmation message to forms and provide Ajax out of the box #5307
Conversation
Concept by yours truly 😇 I think it would be a great addition to the core, thanks for the PR @qzminski! |
…widget is configured incorrectly
Using |
Co-authored-by: Martin Auswöger <martin@auswoeger.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#5307 (comment) needs to be addressed, rest approved ✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have just pushed the commit that uses Webpack to generate the JS assets. Please review and confirm. |
dc43421
to
324cab3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look all good, but the problem remains that as soon as there is a confirmation message, the form is never rendered in the front end (see #5307 (review)).
I can confirm the issue. The problem is that the DCA field for the confirmation message and the template variable have the same name. The template will automatically be filled with all the contao/core-bundle/contao/classes/Hybrid.php Line 228 in f219456
And thus
will always be true once a confirmation message has been set. |
aad67dc
to
176c393
Compare
I have fixed the issue in 176c393. |
Thank you @qzminski. |
I have added an option to define a confirmation message in the form settings. There is no longer a need to create a dedicated confirmation page – the confirmation will appear on the same page after a reload.
The redirect feature is still in place, however. Moreover, I have added the
{{form_message}}
insert tag, which can be used on the target page to display the confirmation message defined in the form settings.Another significant change is that the form now works with ajax out of the box. This concept was taken from the well-known extension https://github.com/terminal42/contao-ajaxform
Problems to discuss:
replace()
orreplaceInline()
method. @ausi can you shed some light on this?I'm looking forward to your feedback!