Ecommerce Shopify WordPress Discussion

How to intercept submit of form in Elementor popup

I have created a popup that will be used as a login form + integration with third-party services (not important for the case). I want to intercept the form submission and send the username and password to a custom API to perform authentication and return a session token. How do we achieve this with JS? I tried the following: $ = jQuery $( document ).on( 'elementor/popup/show', ( event, id, instance ) => { const formElement = document.getElementById("login-form"); formElement.addEventListener('submit', function(event) { event.preventDefault(); event.stopPropagation(); console.log(formElement) } ); } ); But the console output shows the form data empty and the submission is done, rather than stopped in any way. I am new to Elementor and Wordpress so maybe it is something really stupid. I was expecting the submission to be blocked and the console log to output the username and password. How to use this form input to call a custom API? "Action after submission" option in the form I think will not work as I need to pass the form data in a specific format to the custom API.
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.