Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Currency Field?

Avatar

Former Community Member

Hi there,

Does LiveCycle Designer not have a currency field as a field type?  It has numeric and it has text, but no currency?  Do I really have to manually tell this expensive program how to accept currency values such as the oh so uncommon US dollar sign? 

I set my field type as "Numeric" and in "Validation Pattern" I listed the following for the "Validation" and "Edit" patterns:

zero{0}|num{zzzzzzzzzzzz9}|num{z,zzz,zzz,zz9}|num{zzzz9.zzz}|num{z,zzz,zz9.zzz}|num{zzzz9.999}|num{z,zzz,zz9.999}|num{$z,zz9.99}

I listed the following for the "Display" pattern:

zero{0}|num{$z,zz9.99}|num{$zz,zz9.99}|num{$zzz,zz9.99}

When I test the field, it does not allow me to enter the dollar sign ($) in the field.  For example, if I enter "$123" into the field then exit the field the data then disappears. I can enter "123" and it converts it to $123.00 when I exit the field, which is what I want.  However, our users need to also be able to enter the US dollar sign and not have their data disappear if they do. 

Please help.

Thank you.

1 Accepted Solution

Avatar

Correct answer by
Level 10

You can allow characters other than numbers in numeric fields when you use quotes.

Here an example for an edit pattern:

null{}|zero{9.88}|num{'$'zz9.88}|num{zz9.88'$'}|num{'$ 'zz9.88}|num{zz9.88}|num{}

It allows $123, $ 123, 123.45, 123.45$ and 123.45 $

The decimal places are optional if you use the 8 pattern after the dot.

And here is the display pattern.

null{9.99 $}|zero{9.99 $}|num{zz9.99 $}

View solution in original post

5 Replies

Avatar

Level 9

Hi,

Typically Numeric Field, Decimal fiels is used to enter numeric digits. You can not enter other than that, if you do, it gets erased. LiveCycle Designer does not have a currency field. But there is validation part you can use num.currency{}. But it probably it may not solve your problem. You need to do bit of programming with JavaScripts and regular expressions.

Thanks,

Bibhu

Avatar

Correct answer by
Level 10

You can allow characters other than numbers in numeric fields when you use quotes.

Here an example for an edit pattern:

null{}|zero{9.88}|num{'$'zz9.88}|num{zz9.88'$'}|num{'$ 'zz9.88}|num{zz9.88}|num{}

It allows $123, $ 123, 123.45, 123.45$ and 123.45 $

The decimal places are optional if you use the 8 pattern after the dot.

And here is the display pattern.

null{9.99 $}|zero{9.99 $}|num{zz9.99 $}

Avatar

Level 9

Excellent solution Marcus. Never thought of that...

Thanks,

Bibhu.