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
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
Hi Anne,
Thanks for this I will give it a try.
Regards
Michael
Michael O’Sullivan
Director
Digital Technology Training
Web: www.digitaltechnologytraining.com
Email: training@digitaltechnologytraining.com
C: +44 (0)7802866807
Hi Michael! It looks like Anne has you covered here. I just wanted to let you know that replying to the forums via e-mail attaches your signature. You are welcome to pop in and edit if needed.
You're very welcome! I hope it solves the problem. If not, just let us know!
This discussion is closed. You can start a new discussion or contact Articulate Support.