Forum Discussion
Control Chars on Entrytext
Hi everyone!
I´ve been trying to limit characters by using JavaScript programming, but it does not work!
Anybody could help me?
Thanks!!
You should use >= instead of ≥. Don’t use a keyboard shortcut to insert the "greater than or equal to" operator — use the correct JavaScript syntax.
If that’s not the issue, try inserting the code below. It works in the attached .story file when the user clicks the Submit button.
var player = GetPlayer(); if(player.GetVar('entradadetexto').length >= 5) { alert('it is too long'); player.SetVar('isDisabled', false); } else { player.SetVar('isDisabled', true); }
If it still doesn’t work, upload your slide so someone can take a look at the triggers setup.
2 Replies
- NedimCommunity Member
You should use >= instead of ≥. Don’t use a keyboard shortcut to insert the "greater than or equal to" operator — use the correct JavaScript syntax.
If that’s not the issue, try inserting the code below. It works in the attached .story file when the user clicks the Submit button.
var player = GetPlayer(); if(player.GetVar('entradadetexto').length >= 5) { alert('it is too long'); player.SetVar('isDisabled', false); } else { player.SetVar('isDisabled', true); }
If it still doesn’t work, upload your slide so someone can take a look at the triggers setup.
- TatianaLeon-dfeCommunity Member
Wow!!
You did it!! Thank you!!
Related Content
- 3 months ago
- 10 months ago
- 8 months ago