Forum Discussion
ErinSadler
7 years agoCommunity Member
Text entry must contain
Hallo - I've been trying to find or think up a workaround for this but I can't! Can anybody help?
I have a text entry field that I want users to complete - they can write anything at all, but it m...
Steven_Haigh
4 years agoCommunity Member
Hi Jerry, Not sure if you can help again. I am trying to get the java scrip to include upper case and lower case, so I have just copied and pasted the line relating to the word and changed the first letter to upper case. This now only accepts the upper case word and ignores the lower case. Are you able to help?
var player = GetPlayer();
var str = player.GetVar("draincoolant");
var n = str.search("drain");
var n = str.search("Drain");
var m = str.search("coolant");
var m = str.search("Coolant");
if(n >= 0){
player.SetVar("draincoolant", "Drain coolant");
}else if(m >= 0){
player.SetVar("draincoolant", "Drain coolant");
}else{
player.SetVar("draincoolant", str);
}
Related Content
- 8 months ago
- 10 years ago
- 2 years ago