Java Script/Passwords

May 08, 2020

This is driving me insane.

I want to create 2 password protected branches launched from the same page.

I have created 2 J scripts (password and password1) each pointing to a separate variable.

Both passwords work correctly; when password A is entered correctly the trigger links to the correct branch A but when password B is entered correctly it still goes to branch A. When the incorrect password is entered in either field the trigger behaves correctly and sends the user to the "incorrect" page but only for password A - it ignores the B branch and "incorrect" page each time (I tried creating 2 separate "incorrect" page to see if that helped...). 

I have checked the triggers until I am blue in the face. I tried deleting and recreating the triggers and the same thing happens every time. Is it driving me nuts. Any thoughts?

Thanks Michael

4 Replies
Anne Seller

Hi Michael,

It sounds like the TextEntry variable is keeping the original input, so you might have to add a trigger to „Adjust variable“ TextEntry =Assignment, Value= (blank) when (something happens, i.e. when „Variable changes“ (password) or when the Timeline starts on another slide, etc.) in order to "reset" the TextEntry variable, so it will take on the value of the new text when it is entered the next time.

Also, in case you don’t already know, you can check the current value of a variable by adding a text box to the slide and then inserting the reference to that variable within that text box. Seeing the current value of a variable is very helpful when troubleshooting.

If that doesn’t help, could you paste your Javascript code here, so we can take a look?

Cheers,

Anne

This discussion is closed. You can start a new discussion or contact Articulate Support.