Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Acrobat Pro - Converting Letters to Numbers

New Here ,
Nov 23, 2016 Nov 23, 2016

My first time here. I know how to use the basic functions I need to create a form. But I have a problem I can't find the solution to anywhere. To simplify it, let's say I have two text boxes. In the first text box I want to be able to type any one letter of the alphabet. When I do that, I then want the second box to update to assign that letter a numerical value on the basis that A=1, Z=26.

Do I have to format one text box as a Number box? Which box do I put the code in? What code would I use?

If I can solve that problem, I can replicate the solution as I need, and then use simple calculations that I need to do,

Can anyone help?

Thanks

TOPICS
PDF forms
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 27, 2016 Nov 27, 2016

So you want to assign a numerical value to a letter. Is capitalization important?

You should be aware that since the dawn of computers alphabetical symbols have has unique number assigned to each character and symbol. The 2 main encoding standards are EBCIDIC and ASCII. Many programing languages include a statement or method to convert an character string value to the encoding number value. For JavaScript this is the "charCodeAt()" method. Uppercase and lower case character have different values, so it is important to know the case of the character or force all the character to one case. Lowercase characters have values from 97 through 122 and uppercase characters have values from 65 - 90.

The following code will list the codes and values for the lowercase alphabetical characters:

var alpha = "abcdefghijklmnopqrstuvwxyz";
alpha = alpha.toLowerCase();
console.println("Pos\tChar\tCode\tNumber");
for(var i = 0; i < alpha.length; i++)
{
console.println(i + "\t" + alpha + "\t" + alpha.charCodeAt(i) + "\t" +  (alpha.charCodeAt(i) - 96));
}

How are you planning on dealing with numbers as strings?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 27, 2016 Nov 27, 2016
LATEST

Hi,

Thanks for your help, although it's getting into territory too complex for me. My level is pretty basic. I'm using Adobe Acrobat to design a form that will be an online check for a puzzle I am designing for geocaching.com. It's a crossword, but the letters have to have numerical values so that a set of coordinates can eventually be derived from the letters. So, users will enter in letters, but they need to be assigned a value between 1 and 26 in another text box so the form can do calculations to solve the puzzle. Once the letters are assigned a numerical value in the text box (one for each letter entered - each letter with its own text box, that is), I know how to do additions on Acrobat, which is all I need.

Let's go for uppercase if that's an issue.

The solution I need is to know how to assign a number to just one text box based on the entered letter in another. Once I know that, I can replicate the solution over the form, and for other forms I need to design.

Thanks again. Hope that makes sense.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines