Forum Discussion
francoismarais
2 years agoCommunity Member
capital letter always
Good morning I would like to have students enter information but I would like this information to always appear in capital letters even if the person enters in lower case I don't see an option in ST360 THANKS
- SandeepGadamCommunity Member
Hi francois marais, I've created a sample SL file as per your requirements. Add an execute javascript trigger in SL as per your requirement (timeline starts/ends or when user clicks).
Code for ALL CAPS:
var player = GetPlayer();
var newVar = player.GetVar("TextEntry");
newVar = newVar.toUpperCase();
player.SetVar("TextEntry", newVar);Code for Initial Caps:
function capitalizeFirstLetter(string) {
return string.replace(/\b\w/g, function(l){ return l.toUpperCase(); });
}var player = GetPlayer();
var newVar = player.GetVar("TextEntry");
newVar = capitalizeFirstLetter(newVar);
player.SetVar("TextEntry", newVar);Let me know ff you need any further help!
- WaltHamiltonSuper Hero
There are some fonts that have only capital letters. You might use one of them to format it.
- francoismaraisCommunity Member
Yes thanks Walt it is finally the solution that I had kept because it is the simplest to implement
- WaltHamiltonSuper HeroYou're welcome. PIAWYC (Pass it along when you can).