Forum Discussion
JoyZanni
2 years agoCommunity Member
Text Entry Value displayed as drop-down menu when course is revisited.
Hello E-Learning Heroes Team!
I'm building an excel simulation course using the Text Entry variable feature. I'm running into an issue where the use can view previously typed responses in drop-dow...
PhilMayor
2 years agoSuper Hero
It is autocomplete in the browser try adding this as a javascript trigger on timeline start of your slide.
var els = document.getElementsByTagName('input');
for (var i=0; i < els.length; i++)
{
els[i].setAttribute("autocomplete", "off");
}
- ElizabethPat1233 months agoCommunity Member
Thank you, Phil. The code above did not work for me in Chrome but when I asked ChatGPT for an assist to make it work, she/they/it said I needed a delay because "Sometimes, Chrome’s autocomplete overrides your JavaScript if it runs too early."
This modification of your code worked:
setTimeout(() => {
var els = document.getElementsByTagName('input');
for (var i = 0; i < els.length; i++) {
els[i].setAttribute("autocomplete", "off");
els[i].value = ""; // Clear the input value explicitly
}
}, 100)
Thanks for being a Superhero!