Explore the community Forums Lectora Lectora Questions & Answers Character Counts in Entry Fields Reply To: Character Counts in Entry Fields

#435364 Score: 0
Profile photo of Brian Robertson
Brian Robertson
Member
beginner
intermediate
LUC16 Attendee
curious george
wise owl
contributor
profile
13 pts
@brobertson4402

Try this. Although it doesn’t accommodate all the possible keystroke possibilities including arrow keys, backspace, delete, etc … it will count only changes to the entry field.  I’m using a character count of 10 rather than 300 in this example.

Create a variable to hold your character count, i.e.  c1 with an initial value of 10.

Add the following actions to your Entry Field:

Trigger:  Select/Change
Action:  Modify Variable
Target:  C1
Type:  Subtract from Variable
Value: 1
If:  C1 Not Equal To 1 (C1 equals 1 when the learner type the 10th keystroke)
Else: enable the ‘Next’ button or whatever you want to happen when hitting the keystroke threshold

Like I noted, this won’t allow for every possible keystroke but it will force the learner to type in the Entry Field.  Unfortunately the triggers available when adding an action to an Entry Field are limited.