Forum Discussion
DawnFriedel-9bd
7 years agoCommunity Member
Limiting Text Entry to One Character
Hi All,
I'm working on a crossword puzzle and want to restrict the text entry fields to one character.
I'm sure this can be done in JavaScript, but that is a skill I am still working on acquirin...
StephanieDg510
5 years agoCommunity Member
Hi!
From your code, I asked the programmer on the team I work in and we came up with this code and it works.
var elements = document.getElementsByTagName("input");
for (var i = 0, element; element = elements[i++];) {
element.setAttribute('maxlength', 1);
element.setAttribute('autocomplete', 'off');
}
Jean-Christo203
2 years agoCommunity Member
This actually worked, but now I have a question...
How to make it so spaces aren't counted as a character?
Related Content
- 11 months ago
- 8 months ago