App Lab code not working

Hi,
I am planning to share this app template with my students for them to work on for the project. I have done the basic code. However when I click on run it starts to homepage and when I click on the button it does not move to the next page. Also the codes do not change with each screen, but are all the same.

Greetings @e.fat,

Deduction

The main reason your code is not working as intended is that the button that you had set an event (listener) on is not the correct id

Solution

the following bellow should achieve the possible result your looking for

onEvent("two_factorbutton", "click", function( ) {
  setScreen("Homepage");
});
onEvent("Homepage_button", "click", function( ) {
  setScreen("Two_factor_page");
});

if you look on the page the holds your button for this you will see that “Password_Button” does not exist but probably does on one of your other screens you have setup

Conclusion

Going forward you should be careful on how you use id schemas as they will be harder to remember if you don’t have a strategy or some form of guideline to reference when setting up more complex apps that use more elements and buttons

Varrience