1 Reply
Sam Hill

Hi Alfi, this isn't possible using Storyline alone, but can be done with a little bit of JavaScript. I've attached an example for you.

This is the code I have added. It simply looks for all input fields on the slide and then applies a (standard) attribute to the input field which will restrict the string length to one character.

The only thing you have to be careful of is that the <input> field can turn in to a <textarea> if you make it larger (I think over two lines in height) and the JavaScript will no longer work. I assume though, if writing a crossword, your input fields will be small boxes as I demonstrate in the Storyline file I've uploaded.

var $inputs = document.querySelectorAll('input[type=text]');
$inputs.forEach(function(obj, ix){
obj.setAttribute("maxlength",1);
});