Hey guys,
Im trying to set an automation that will trigger a popup message when a user submits a form. I created a lightbox for the pop up message and used the code below but i get an error. Can anyone please help me out with the right code for this automation?
Code used:
import wixWindow from ‘wix-window’; //
/**
- Autocomplete function declaration, do not delete
- @param {import(‘./schema.js’).Payload} options
*/
export const invoke = async ({payload}) => {
$w.onReady(function () {
$w(‘#contactform’).onWixFormSubmit((event) => {
wixWindow.openLightbox(‘page1’);
});
});
return {}; // The function must return an empty object, do not delete
};
Thanks in advance!