Character Counting w/o spaces
Hello folks,
To start, rest assured I am not a student looking for answers on homework. Rather I am a graphic designer who stepped out of his box a bit too far and need help. I am wanting to have a textbox (Text1) for entering info and a separate textbox (Text2) display only the numbers of characters used [without spaces]. I don't even need the msg part either, just a number that is counting as the customer types. We are charging by the actual character for this form and not the spaces. Below is the only code I have found to function in my document, however it is beyond me on how to adjust it to my needs. Please help and thank you!
THIS ONE WORKS:
(Drop into ‘Custom Keystroke Script’)
Javascript below is for a character cnt w/spaces and a message of remainder.
if (event.willCommit == false) {
var ec = event.change;
var nv = event.value + ec;
var nc = nv.length;
var msg = nc + " characters typed.\n";
msg += (3000 - nc) + " remaining.";
this.getField("counter").value = msg;
}
