Forum Discussion
JoshuaBruck
5 years agoCommunity Member
Text Entry Submit on Enter
Hi all,
I know this has been asked and answered a lot, but I still seem to have great difficulty with using text entry and having the user use the [Enter] key to submit. I keep reading that if the...
PhilMayor
4 years agoSuper Hero
If you use a text entry question you can set the enter key to submit the interaction, shouldn't add a line return.
If it does use this:
document.activeElement.blur();
var player=GetPlayer();
var someText = player.GetVar("text_1");
someText = someText.replace(/(\r\n|\n|\r)/gm, ""); player.SetVar("text_1", someText);