These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Convet Numbers into Words

crayzme
Registered: Dec 4 2009
Posts: 27
Answered

I have a form with a field that the user enters in a numeric quantity (Text1) I want to have a script convert that data from text1 into words in text2.

How can I accomplish this?

All your help is greatly appreciated as I am a Javascript / Acrobat Virgin just starting to learn how all these comands work.

Thanks!!

- Tom

My Product Information:
Acrobat Pro 8.1.7, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
LiveCycle Designer has a 'Num2Word' function.

For AcroForms Adobe provided a PDF check form with a 'numtowords' function, see [url=http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=20590]Number to Text[/url].

George Kaiser

crayzme
Registered: Dec 4 2009
Posts: 27
Thank you for the response!!!! But I need more help (a 2x4 to the forehead might work for me)

For some odd reason my software vendor told us we can not use lifecyle to create our forms due to incompatability reasons...

I pasted the large script from the link you gave me into :

Advanced / Document Processing/Document Javascripts/ ConvertToWords

I then pasted the short script:

var nValue = this.getField("Text6").value;
event.value = ConvertToWords(nValue);

Into the field I want the words to appear (Text6 is where the numbers are inputted to)

I get nothing... what I am I doing wrong?
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Your consultant should have fully explained what he/she meant. If you have users with Reader or Acrobat before 5.1 there are all sorts of issues. Acrobat 9 is buggy and has many issues with LiveCycle Designer forms.

I just tried it and it works for me with Acrobat 8. This is basically the code from the version 4.0 example provided by Adobe.

Make sure you deleted the Acrobat 'assumed' function definition, you should only have the provided code as the function and you copied the entire code for the functions, there is a series of variables outside of the functions and there are 2 functions that need to be copied. You also have to have the Acrobat preferences set to allow the running of JavaScript.

Do you get any error messages in the JavaScript console?

George Kaiser

crayzme
Registered: Dec 4 2009
Posts: 27
I have gotten it to work!!!!! The only issue is that You enter the numbers into TEXT6 and then The words wont auto populate into TEXT7 unless you put a character in it. But I can live with it unless you have a fix suggestion...

Thank you SO MUCH!!!!!!
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Are you using the 'custom calculation'?

George Kaiser

crayzme
Registered: Dec 4 2009
Posts: 27
aHHH That worked! I had the script only under custom keystroke, now I have it in both spots and it wrks perfect!

You have just made many many people very happy!!!!! Thankyu so much!