Hi,
I have a free account and I’m trying to add a lightbox close action to the Submit form button.
I followed these instructions: https://www.wix.com/code/home/forum/community-discussion/add-lightbox-close-action-to-the-submit-form-button But it is not working.
I can’t find the name of the submit button. When I place the mouse there, it says ‘wixShoutoutWidget1’.
Could you please provide me the specific code I need?
Thank you.
Place a button on your page then right click on the button and select “view properties”, there you will see the ID for the button. Then code something like this…
import wixWindow from ‘wix-window’;
$w.onReady( function () {
$w(‘#submitButtonID’).onClick( function () {
wixWindow.lightbox.close(“lightboxID”);
})
})
Thanks for your answer.
I tried it with:
import wixWindow from ‘wix-window’;
$w.onReady( function () {
$w(‘wixShoutoutWidget1’).onClick( function () { wixWindow.lightbox.close(“lightbox1”);
})
})
Doesn’t work though.
Any other idea please?
Anybody else can help me please?
Hi,
Is the button connected to the dataset with submit action?
If so, Defining two actions to one button can cause unwanted behaviour. So, in the case I would sue onAfterSave method to close the lightbox.
For more information:
Good luck!
Roi.