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

Converting a Numeric Amount to a Written Amount

Lady Di
Registered: Feb 18 2009
Posts: 86
Answered

I am new to LiveCycle Designer and a novice with Java script. I have a form in Adobe Professional 8.0 that I want to put into LiveCycle Designer. However, when I move the from to LiveCycle, I loose all the JavaScript that I had in Adobe Pro. On this particular form, I had document level script that would convert a numberic dollar amount to a written dollar amount. How can I get this functionality in LiveCycle Designer?

My Product Information:
LiveCycle Designer, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Have you looked up the function "WordNum()" in the LiveCycle Designer 'Scripting Reference' under 'Help' on the menu bar of LiveCycle Designer?

George Kaiser

Lady Di
Registered: Feb 18 2009
Posts: 86
I found the syntax for WordNum and I read the section about FormCalc vs. Java. It looks unbelievably easy, however, I can't get it to work. I just created a sample form with a numeric field and a text field. I want the text field to automatically populate after the numeric field is filled in. Where do I need to put the WordNum syntax in order for this to work?
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
You can place the code in the 'calculate' event for the text field.
// convert field DecimalField1 to wordsWordNum(DecimalField1, 2)

or the 'exit' event of the numeric field
// convert this field's value to text and place in TextField1TextField1 = WordNum($, 2)

George Kaiser

Lady Di
Registered: Feb 18 2009
Posts: 86
That is exactly what I needed. Thank you very much for your help.