Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Drop-Down List stored value error in textfield (wordnum)

Avatar

Level 2

I am having trouble with the Drop-Down List as the selected value must be expressed in word.

Please be guided by the images below:

px1.png

px2.png

Amount Deducted - Drop-down list with values in numerals. User entered

Amount in words - Textfield. Calculated to the get the value of Amount Deducted express into words using this script:


if (not (form1.#subform.AmoundDeduction").isNull) then 


  $ = Concat( Replace( Replace( Replace( Replace( Upper ( WordNum("form1.#subform.AmoundDeduction"), 2) ), "DOLLARS", "PESOS" ), "DOLLAR", "PESO" ), "CENTS", "CENTAVOS" ), "CENT","CENT"), " ONLY" )


else 


  $ = "" 


endif


Expected Output:

px3.png




Thank you in anticipation of your positive response.

2 Replies

Avatar

Level 10

I think the problem is, that you put the object reference in the WordNum() method into quotes.

Change

WordNum("form1.#subform.AmoundDeduction")


Into

WordNum(form1.#subform.AmoundDeduction)

Avatar

Level 2

Sir radzmar

Thank you for prompt response. I change the script by removing the double quote ("") but I am still getting this:

px2.png

You may check the file [HERE]