Forum Discussion
KN2026
2 days agoCommunity Member
Javascript/Trigger Help
Hello! I'm trying to set up an activity where learners complete a system screen/field (create your own code). The requirement is that it must be at least 2 characters and no more than 14 characters l...
Nedim
2 days agoCommunity Member
Here’s why your JS code isn’t working:
1. In your script, you’re retrieving the text variable "TextEntryPG", but the correct name defined in the Storyline variable panel is "TextEntryPG1".
2. The number variable "number_of_characters" is not defined in Storyline, so the script is throwing an error.
3. The event handlers used to validate conditions are inappropriate; all validation should occur on a button click, as shown in the third screenshot.
I’ve fixed all the issues and attached a working version for you to review.
Related Content
- 2 years ago