Forum Discussion

GaryMiller-f990's avatar
GaryMiller-f990
Community Member
3 months ago
Solved

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...
  • SamHill's avatar
    2 months ago

    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');
    });