Expand my Community achievements bar.

Issues with Numeric Field

Avatar

Former Community Member
Hello,



Is there a way to custom input in numeric filed? I want to create a numric field where the user can enter the amount like "234,345,56.00" I mean the user is used to typing "Comma's" and they are not willing to give it up. How do i create a numeric field where the user can input comma's?



Thanks

Balaji
6 Replies

Avatar

Former Community Member
Balaji,

Try using zzz,zzz,zzz.99 for your edit pattern and zzzzzzzzz.99 for your display pattern.



Justin

Avatar

Former Community Member
when inputing data in a numeric field, if the result is a negative number, I would like the number to show in red. It will show a negative sign or put the number in parentheses. I would like it to also be in red. What format do I use to indicate this?

Avatar

Former Community Member
One idea would be to use a script on the exit event of the numeric field to change the font's color to red. The script would look like this:



if (this.rawValue < 0) {

this.font.fill.color.value = "255, 0, 0";

}



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
Tried the script for formatting negative numbers in red font and it worked. However, some of the fields are formatted 'global binding' and the script doesn't carry over to the associated field. Any ideas?

Avatar

Former Community Member
The easiest way to solve that problem is to put the script on each field's Exit event since the Global binding setting isn't meant to propagate scrits to each field set as
global.



Stefan

Adobe Systems

Avatar

Former Community Member
Actually a problem with Stefan's idea is that the exit event is only fired for the field that the user exits, not all the globally bound fields.



What you would probably have to do is write your script so that it sets the font color for each of the globably bound fields, and then add the script to the exit event of each of the globably bound fields. So that no matter which field the user enters the value in, all of them have their font color changed.



Chris

Adobe Enterprise Developer Support