Creating a character counter with a default starting value of 1 not 0
I'm trying to create a visible character counter that has a default start of 1. Currently, the first letter I type displays as 0. Here is the script I have in my keystrokes:
if(!event.willCommit)
{
var nChars = event.selEnd - event.selStart;
var aFull = event.value.split("");
aFull.splice(event.selStart, nChars, event.change);
var strFull = aFull.join("");
var aWrds = strFull.split(/\s+/);\
this.getField("Text1").value=event.value.split("").length
}
I'd also like the counter to revert to 0 when the field is empty.
