connect a window (lightbox) using a conditional

Good morning, I have a login which works perfectly what I am looking for is the following, I would like the error message of the credentials to appear in a window (light box) I already create it but I cannot connect it, someone could help me


my window is called “error message” “#messageerrror

Hi there :wave:t2: This is pretty simple to do.
Step 1: you will need to import wix-window at the top of your code.

import wixWindow from 'wix-window';

Step 2: Use the openLightbox function, like below

wixWindow.openLightbox('Lightbox Name');

However, lightboxes are notoriously slow, and if you open a new Lightbox you have to then send a user back to the previous Lightbox, which will make it even slower and annoying for the user.
You might be better off using a container box attached to cover this lightbox, and use hide/show instead, since this can happen much quicker than a lightbox.