Help creating a password with a button that shows an error when it is incorrect but when it is correct it should go to a new page.

The page just looks like this

While the code that I have is

import wixLocation from ‘wix-location’

$w . onReady ( function () {
$w ( “#myButton” ). onClick ( function () {
if ( $w ( “#myPasswordInput” ). value === “GlobalEducation” ) {
wixLocation . to ( “/Home” );
} else {
$w ( “#errorMessage” ). show ();
}
});
});

Even with the correct password my login button does not do anything. Also how do I go about making it so that when the password is incorrect they are able to re input it?

Try /home (lowercase). Also make sure you type the password correctly (case-sensitive)

Thanks! that actually solved it.

A post was split to a new topic: Create a password protected page