Disable next button until user enters text into all text entry fields on slide

Apr 16, 2015

Hello- I have been successful in disabling the player next button in drag and drop situations and in counter situations but I cannot figure out how to disable the next button until the user has entered text in several text boxes on the slide. 

Thanks in advance!

41 Replies
Michael Laudone

Hi Marcella,

Again, variables are going to help you.

  1. Set up a variable, e.g., clickInBox of Number type.
  2. Set up a trigger on your text box. so that when the learner clicks into the textbox, have the variable update.
  3. On the next button,
    1. change the state to hidden
    2. add a trigger so that it changes states when the variable changes to  a certain number (a add a condition) so that is runs when the variable reaches a certain number.

There may need to be some error captures but it should work.

Marcella Simon

Thanks Michael! That way had worked with drag and drop but when I tried it
with text entry, it did not work. I must be doing something wrong.

I set up a variable FillBox with an initial number at 0.

I then set it up to change to 1 when user clicked the text entry box.

I had disabled the next button (upon timeline starting) and then made it
normal when the count reached 1

Greg Faust

What object is the "Change State of Next Button To State Normal..." trigger attached to? In other words, is the trigger listed under "Player Triggers", a layer name, or some other slide object?

In my experience, triggers can fail to activate when they're attached to an object that doesn't want to activate triggers. Specifically, I've had to change my triggering event such that a trigger would NOT be attached to a hidden object. I wouldn't be surprised to learn that Disabled objects present a similar problem.

Michael Laudone

Sorry, Marcella! I didn't actually test this I just gave you the steps at I understoond.

THERE IS ANOTHER BUG in this software. For some reason, when you adjust the variable it is returning a non-numeric value (even though the logic clearly says to adjust the variable to a numeric value).

There's a convoluted way around this...as I've found with this application...instead of changing the value of FillBox when user clicks in the TEB, create another variable (ClickedInBoxTF) that is boolean set to false but changed to true when the user clicks in the box. NOW, change FillBox to a value based on the ClickedInBoxTF ==  True. Tested this and it worked but way too cluggy.

Greg Faust

My inclination would be not to disable the "Next" button, but rather to attach a conditions. If you select your text entry box in the editor, you'll see (in the triggers list) that by default it dumps the student's entry into a text variable. So one trigger would be:

Jump to slide
next slide
when User clicks
Next button
[show conditions]
TextEntry1 Not equal to [default] 
AND TextEntry2 Not equal to [default]
AND TextEntry3 Not equal to [default]

This gets at the heart of what you REALLY want: The text entry variables must be populated with something other than their default values. If the user has not typed something into each box, the Next button won't take them to the next page.

Then you'll want a trigger to display an error message if the user HASN'T filled in all the boxes. Make a new layer and call it "Error Message". Put a big friendly text box into it that says, "You must enter all the text fields to continue". Also add a button that says "Okay!" and has a "Hide this layer when user clicks this button" trigger.

Now you need this error layer to come up at the appropriate time. Copy that first trigger on the "Next" button, and in the conditions, change the "ANDs" to "ORs" and the "Not equal tos" to "Equal tos". Also change the trigger so it shows the message:

Show Layer
Error Message
when User clicks
Next button
[show conditions]
TextEntry1 Equal to [default]
OR TextEntry2 Equal to [default]
OR TextEntry3 Equal to [default]

I don't know for sure whether Storyline can handle empty space for the [default] variable value, so you'll have to play around a little.

Ashley Terwilliger-Pollard

Hi Marcella,

It looks like Greg has you covered here, and text entry boxes automatically create variables, and their default is set to empty as a built in functionality, so I'm not sure what element you're having difficulty with? You may want to post what you've got set up so far in terms of triggers and variables, as that way we can take a look at what you've set up. 

Marcella Simon

Thanks Ashley!

I guess my difficulty lies in setting up the trigger conditions for the "not
equals" default for the text box variables. If the variable for the text box
is TextEntry would the statement read:

Jump to next slide when user clicks on next button

Condition:

TextEntry is not equal to value default?

Greg Faust

Replace the word "default" with whatever you have set as TextEntry's default value. You can view and edit default values in the variable manager (see image).The variable manager button

Also, if you're planning to use these variables later in your course, you may want to give them more descriptive names. For example, "StudentFirstName" or "FavoriteAnimal" (or whatever information you're asking them to enter).

Also also, be aware that you can display these variable values with %[variable name]%. For example, say the variable StudentFirstName is set to Steve. A text box that in the editor that says "Your name is %StudentFirstName%." will publish as "Your name is Steve.". This is great for debugging and for giving feedback to the learner.

Marcella Simon

Thanks Leslie! I am still playing around with this and everyone has been
very helpful. My problem is still with the automatic default for text
boxes. I have put in examples of sentences in the text boxes to be
overwritten which is messing up putting in values like numbers or
true/false.

Marcella Simon

Thanks everyone for your help! I am hitting one snag in this scenario and
that is how to express the default for the text boxes in the trigger.

I have three boxes named tech, mach, and admin.

In one scenario:

Jump to slide
Next slide
When user clicks
next button
AND
tech
is NOT equal to

In the other scenario:

Change state
Next button
Normal when focus loses control
tech
AND
mach is NOT equal to

Margaret Murphy

Hi all,

I was going to post the same question but since a conversation related to this subject was already started I thought I would post here. I am having similar trouble to Marcella and *think* I understand and correctly applied the solutions discussed here but I still can't get my slide to function the way I want it to.

 

In the Self Check slide, I want the students to HAVE TO fill in all four text entry fields before they can move on to the next slide.  As Greg suggested I created a layer called "Unfinished" that students get if they try to submit less than all four answers. That trigger seems to work fine.

 

My issue I am experiencing is that even if all four data fields have text I STILL get the Unfinished layer appearing rather than going to the next slide. I thought I built the trigger correctly but I need a second (or third or fortieth) pair of eyes to help me.

 

Thanks in advance