'elementor - execute javascript after custom form submit action
I added a custom "after form submit" action for elementor but if I recho some result I get console errors when using "submit_success" event listener:
Uncaught ReferenceError: originalEvent is not defined (common.min.js)
Uncaught TypeError: e.data is undefined (preloaded-elements-handlers.min)
I don't know what to return to avoid them and get my code executed. Maybe I use a wrong approach?
Solution 1:[1]
Found the solution myself: I need to use the $ajax_handler method like $ajax_handler->data['hello world'] inside the run() function.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Insomnia88 |
