Forum Discussion
Help for interaction in text insert field
Hi Nedim, thank you for your answer, too.
Do you also use javascript? Perhaps I make a mistake but I cannot copy your idea to involve it in my story. Could you send me a story-file?
Yes, I use JavaScript to enhance the text entry field functionality. Specifically, I limit the maximum allowed characters to 1 initially and then increase the limit by 1 for each correctly typed character, up to a maximum of 4 characters.
Additionally, JavaScript allows me to update the text entry value in real-time as the user types, rather than waiting for the field to lose focus. While it's possible to achieve this functionality without JavaScript, it would be more complex and less user-friendly. Without JavaScript, the user would need to click outside the text entry field to trigger validation and update the value after each character is entered.
I also use Storyline True/False variables (e.g., Level1, Level2, etc.) For each correctly typed character, I set the corresponding variable to True in my JavaScript code. Based on the values of these variables, I unlock the level buttons accordingly.
The implementation might be a bit complex and could definitely be simplified with less code if needed. My main goal is to ensure that all levels are unlocked if the user types all characters correctly. However, if the user enters an incorrect character, the levels are immediately locked again.
I've attached my .story file. Let me know if you need further assistance with adjusting the code.
- ClaudiaGlase2 months agoCommunity Member
Thank you for attaching the story. The aspect to update the text entry value in real-time is interesting. I did same visiual basic in excel long ago so I understand your java script roughly and can adjust it to my purpose.