Problem on Crossword in storyline360

Aug 12, 2020

Hi guys,

Need help you, I create crossword in my storyline360, but the text entry field can still be filled with more than one character, how do you make one text entry field for one character only?

Thanks all.

2 Replies
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);
});