Acrobat form - how to take advantage of the first letters of the words of field.

I produced my first Acrobat form and am setting the validation rules on certain fields.  I want to ensure all names and addresses are saved with the first letter of each word being a capital as well as the letters are lower case.   While I found and read a few reviews, I have no script experience and positions assume a reasonable understanding of scripting, debugging, etc.

Could someone please explain how I can achieve this.

Thank you

You must understand how the data will be entered and what you want to accomplish. If you want to have a function as title case, then you will need to adjust objects or other words that would not be capitalized. Users will use another character other than a space to separate words?

Since it is an action of formatting, I would put the script as the custom format or a validation script, so that this code is not rerun each time a field used in a calculation is updated.

Assuming that only a space character will separate the words, you can use the method '. split() ' to an array of words in the text entered in a field. You can then browse the array of words and affecting the first uppercase character and the rest of the word in lowercase, using the 'substr()' method or other methods of the property of type string.

The simplest version of this could be:

aInput var = event.value.split(""); make a table divided in space
var sCharacter = ";
Sword of var = ";

for each element of the word table, uppercase the first letter
for (i = 0; i
aInput [i] = aInput [i] .substr (0, 1) .toUpperCase () + aInput [i] .substr (1). toLowerCase();
} / / end of loop for the input string
rebuild the input string with words changed with spaces
Event.Value = aInput.join(' ');

But since you will repeat this code in several areas, I would create document-level functions, so the code is in one place and be interpreted pre and run faster:

function UpperCase (sString) {}
Return sString.toUpperCase ();
}

function LowerCase (sString) {}
Return sString.toLowerCase ();
}

function FirstUpperCase (sInput) {}

aInput var = sInput.split(""); make a table divided in space
var sCharacter = ";
Sword of var = ";

for each element of the word table, uppercase the first letter
for (i = 0; i
aInput [i] = uppercase (aInput [i] .substr (0, 1)) + LowerCase (aInput [i] .substr (1));
} / / end of loop for the input string
rebuild the input string with words changed with spaces
Return aInput.join(' ');
}

You can then use the following code in each domain where you want to force the first character uppercase:

Event.Value = FirstUpperCaseinputinputletter for (event.value);

Another solution would be to use the following code in the format or validate the script:

Event.Value = event.value.toLowerCase () replace (/ \b\w/g, function (match) {return match.toUpperCase () ;});})

This script uses the RegEx object and its method of ". replace() ' using a self funciton set with the corresponding string.

Tags: Acrobat

Similar Questions

Maybe you are looking for

  • Where to find the Version of the OS to?

    Hey all: I was wondering if someone could tell me where I could find that RV # is on my A1-810? It's like 4.2.2 JB. But the number I want is it IE: RV03RC08 or something to that effect. Thanks for your help: Ricky

  • Repeat the Setup commands

    Just bought and installed a Microsoft Wireless Keyboard 800 and Mouse.Now each time that I boot up I am asked to install the drivers (which I already have). When I reinstalled again the same guard going on whenever I start.

  • Not enough memory, but only one partition is almost empty. running Windows XP Home Edition

    My computer says there is not enough memory available to perform the printing.  When I tried to defrag, there is not enough memory to perform this function, either.   Several years ago a friend introduced (then new) computer with 2 partitions - C and

  • Help - pictures deleted by accident!

    I deleted (doh!) to the United Kingdom various photos (round opf London etc) that came when I bought the computer. How to get back?

  • portable devices

    play for sure