Forum Discussion
Minimum Character Requirement on Text Entry
I'm trying to create a 50-character minimum on the text entry input fields for a scenario interaction. I've added JavaScript and additional triggers, but they are not doing what I need. Can someone with more JavaScript knowledge please help me troubleshoot this?
I created a JavaScript requiring a minimum of 50 characters:
var player = GetPlayer();
var text = player.GetVar("vanessahines");
if (text.length < 50) {
player.SetVar("ShowErrorV", true);
} else {
player.SetVar("ShowErrorV", false);
player.SetVar("JumpToNextSlideV", true);
}
If less than 50 characters are entered when the user clicks submit, it should show the layer "Error".
If 50 or more characters are entered, when the user clicks submit, it should jump to the next slide.
But nothing is happening when clicking Submit, no matter how many characters are entered.
- HollyGroszko-4cCommunity Member
I realized the original trigger was still on the submit button, I removed that but it did not solve the issue.