Expand my Community achievements bar.

Format numeric field as user enters value

Avatar

Level 3

I have a numeric field that I want to be formatted as 999-999999-999 so that when users enter 12-digit part numbers, the field automatically formats the value that they have entered. Is there a way to format their value as it is entered so that when they type the fourth number, a hyphen is placed between the third and fourth digit?

Additionally, is there a way to allow a numeric field to have a default value with letters? I want to have a default value of "xxx-xxxxxx-xxx" but I don't want to allow the user to enter anything but numbers in the field. I tried using a text field, but I can't get it to reject letters and only accept numbers.

1 Reply

Avatar

Level 10

Hi,

You can define a display format pattern of "num{999-999999-999}" that will add the hyphens in once they leave the field, or maybe having three fields with the comb option set and hyphens between them would suit more?

You can use the null display pattern to display any sort of text in a numeric, date, or whatever field.  Have a look at this sample, Adobe LiveCycle Designer Cookbooks by BR001: Adding Ghost Text to LiveCycle Designer form

Regards

Bruce