Initial conditional logic not working when forms are loaded dynamically
-
When loading a form dynamically to a page, e.g. by ajax call, the initial conditional logic is not triggered. This is because the plugin only does the initial check on the “elementor/frontend/init” event.
Instead an elementor elements handler class must be used, which then will automatically get attached and triggered on all form widgets once they get loaded.
window.addEventListener(‘elementor/frontend/init’, () => {
elementorFrontend.elementsHandler.attachHandler( ‘form’, YourConditionalLogicFrontendHandlerClass, ‘default’ );
});
YourConditionalLogicFrontendHandlerClass must extend elementorModules.frontend.handlers.Base
Thanks and best regards.
The topic ‘Initial conditional logic not working when forms are loaded dynamically’ is closed to new replies.