Forum Discussion
Change Text Entry Variable without control losing focus?
You all are rock stars! I know just enough JavaScript to be dangerous, though I love the extensibility it adds to Storyline. Inspired by your code, I wanted to use the contents of the input box to simulate a search box, so I added this.
Array.from(document.querySelectorAll('.acc-textinput')).forEach(el => {
el.addEventListener('keyup', () => {
console.log('someone is typing in a box...');
el.blur();
el.focus();
})
});
var player = GetPlayer();
var searchentry = player.GetVar("SearchEntry");
searchentry= Array[1] + Array[2] + Array[3];
player.setVar("SearchEntry",searchentry);
Hi Glenda,
Really cool idea! Would you be willing to explain a bit more how your code works? "SearchEntry" is the input field variable? But also the output? How is it searching through the course for text? How does it display that text, and in context?
Thanks!
Curtis