Unofficial Nextion/TJC User Forum

Password Protection

Is there any way to make the opening screen password protected (Using a 3.5 enhanced screen) without using a control board?

Plenty of ways one could do that. Have the device start on page 0 with a text input and OK button. On OK, check text field for your desired password, then send the user to page 1 or whatever.

Just for fun I mocked up a quick and dirty example for you. Download the HMI here.

Here’s what that looks like:

t0 is our password field so I set pw to Password and key to full qwerty\keybdA.

b0 is the reset button. On the touch press event I have the following:

// Clear the password entry field
t0.txt=""
t2.txt=""

This clears any password entered from t0, then clears the password entry failure message in t2 (more on that below).

b1 is the Login button which has the following touch press event script:

// Check to see if the password is "12345"
if(t0.txt=="12345")
{
  page 2
}
// If we're still here, password was wrong so clear the text field
t0.txt=""
t2.txt="Login failed!\r Try again..."

First, we check to see if the password entered in t0 matches 12345. If so, we take the user to page 2. If not, we once again clear out the password entry field t0 and then display a “Login failed!” message to the user in t2.

Here’s what the demo looks like in action:

Thank you ever so much. You ser are a star, just what im looking for.

I have downloaded the hmi file, everything works as you are showing but the Event box’s are all clear.
I know I will need to add the code to the box’s when I do my own design but why aint it there with your demo?

Sorry my bad I forgot to click on the buttons to high lite them

1 Like

Where may I find the keyboard that you used? of do I just make one? keybdA on the page list, how to create this?
Sorry for all the questions, i’m new to this

Thanks
Should make some time to play around in the software and see what all the settings do


This forum is in no way affiliated with NEXTION®, ITEAD STUDIO®, TJC®, or anyone else really. All product names, logos, and brands are property of their respective owners. All company, product, and service names used in this website are for identification purposes only. Use of these names, logos, and brands does not imply endorsement from the respective rights holder(s).