A bundle bringing compatibility our contao 4 environment.
A bundle enhancing Formhybrid compatibility with our Contao 4 environment.
- support for Encore Bundle
- replaces jquery code with native js code
- js code is automatically added to pages where forms are included (needs formhybrid version >= 3.13)
Not all js features ported yet
Currently ported js features:
- asynchronous form submit
- scroll to status message after submit
- Only encore bundle is currently supported for assets
Add this bundle as dependency
composer require heimrichhannot/contao-formhybrid-compatibility-bundle
Update your Encore bundles file and your compile your webpack dependencies
Check if you need polyfills for supporting IE and (non-chromium) Edge (or other
annoyingoutdated browsers) (see Polyfills section)
submitting class is added to the
form element when doing an asynchronous form submit.
Following events are fired during lifecycle.
|formhybrid_ajax_start||Fired before the ajax call is execute . For example before an asynchronous form submit.|
|formhybrid_ajax_complete||Fired after an ajax event completed. For example after an asynchronous form submit.|
For compatibility with IE and Edge browsers you need to polyfill following js functions:
|CustomEvent||https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent||Optional, no finish event is fired|
Add these polyfills to your main project js entrypoint.
- Renamed namespace from
- JS code is automatically added to forms. If you don't want this, uncheck active on
contao-formhybrid-compatibility-bundleentry in your encore settings.
- Async submit animation: Instead of adding animated dots to the submit button text when doing an asynchronous form submit, a
submittingclass is added to the form element.