Multiple text entries. Need learner to type in each one before submit button can enable

Jun 30, 2023

Hello. I am having a tough time with variables. I have 4 text entries that I need learners to type in before they can hit submit. How do I need to set up my variables to do this? When they get on the page I want the submit button to be disabled. After they type in all 4 boxes, I want the submit to enable. The answers are not graded. It is meant to be a reflective exercise.

1 Reply
Judy Nollet

I can't look at your .story file at the moment, but I'll offer some advice. 

What someone types in a text-entry field is stored in the associated variable. But the variable isn't updated until the field loses focus. In other words, after they type an entry, the user has to move on to something else in order for the variable to change. That's fine for your first 3 fields, since the user moves on to the next text-entry field. But it's tricky for the final one.

So, instead of disabling the Submit button, I suggest you keep it enabled instead. However, give it two triggers:

  • Trigger with conditions that check whether every variable has an entry (that is, the variable does not equal blank). These conditions should be connected with "and" to ensure that all variables have an entry before the trigger will run. This trigger can do whatever you want to happen when the user is done with their entries, such as advance to the next slide. 
  • Trigger with conditions that check whether any variable is equal to blank. These conditions should be connected with "or" to ensure that the trigger will run if any of the fields is blank. This trigger should show a warning message (for example, on a hidden object or on a layer) that tells the user they need to enter something in all 4 fields before they can submit their answers.