This is the code on my login lightbox but I want to be able to press enter to submit, I have a piece of the code for it at the bottom but I wasn’t sure where to put it or what action to put after it (sorry really new to coding)
import wixUsers from ‘wix-users’;
import wixLocation from ‘wix-location’;
import wixWindow from ‘wix-window’;
$w.onReady( function () {
$w(“#forgotPassword”).onClick( (event) => {
//wixWindow.lightbox.close()
wixUsers.promptForgotPassword()
.then( ( ) => {
//
} )
. catch ( (err) => {
let errorMsg = err; //“The user closed the forgot password dialog”
});
});
});
export function loginButton_click(event) {
let email = $w(“#email”).value;
let password = $w(“#password”).value;
wixUsers.login(email, password)
.then( () => {
console.log(“User is logged in”);
wixWindow.lightbox.close();
wixLocation.to(“/account/my-account”); //This reloads the same page and allows code to show hidden member parts.
} )
. catch ( (err) => {
console.log(err);
$w(“#errorMessage”).expand(); // You can delete this line if you are not going to add an error message. Use a regular text element set to ‘collapse on load’ from the Properties Panel.
} );
}
////////////////////////////////////
$w(“#password”).onKeyPress( (event) => {
if (event.key === “Enter”){
///Put here the code for action you want to execute
}
})