Forum Discussion
Text entry fields show previous answers, despite clearing them via triggers
My previous answers keep reappearing when I access one of my courses a second time and click into a Text field. I have tried to solve this in many ways: I have recreated the text fields on new slides, in new files, tested them using different browsers, used triggers to reset their associated variables both on the slide that comes immediately before, and on the slide they appear.
None of these actions solve the problem.
I did (possibly) fix the problem in MS Edge (see screenshot) by turning off Autofill, but Edge users in our organization will have that on by default, and there's no way our IT folks will change it. And the problem persist in Chrome (also possible an autofill issue).
Anyone have a solution that doesn't entail turning off Autofill?
Thanks!
Hi GaryMiller-f990 I believe you would have to be able to add the autocomplete="off" attribute and value to the input field in order to be able to suppress this browser feature.
Storyline doesn't provide an interface for doing this, but you can add the attributes with JavaScript in the following way. Try adding this to the timeline starts trigger (execute JS) on the slide with the input field.
const textInputs = document.querySelectorAll('input[type="text"]'); textInputs.forEach(input => { input.setAttribute('autocomplete', 'off'); });
NB: Text input fields change to textarea fields if you make them multiline. You'd need to do this for textarea fields:
const textInputs = document.querySelectorAll('textarea'); textInputs.forEach(input => { input.setAttribute('autocomplete', 'off'); });
2 Replies
- SamHillSuper Hero
Hi GaryMiller-f990 I believe you would have to be able to add the autocomplete="off" attribute and value to the input field in order to be able to suppress this browser feature.
Storyline doesn't provide an interface for doing this, but you can add the attributes with JavaScript in the following way. Try adding this to the timeline starts trigger (execute JS) on the slide with the input field.
const textInputs = document.querySelectorAll('input[type="text"]'); textInputs.forEach(input => { input.setAttribute('autocomplete', 'off'); });
NB: Text input fields change to textarea fields if you make them multiline. You'd need to do this for textarea fields:
const textInputs = document.querySelectorAll('textarea'); textInputs.forEach(input => { input.setAttribute('autocomplete', 'off'); });
- GaryMiller-f990Community Member
Wow! Thanks so much - this appeared to solve the problem where other suggestions - and things I tried - were ineffective! And the JavaScript required no tweaking. Thanks so much!