Expand my Community achievements bar.

How to set display patterns on a decimal field to handle user text entered in error.

Avatar

Level 1

Hi

I'm creating a PDF in LiveCycle, which has a decimal field with the display pattern 'num{zzz,zzz,zz9.99}'.  The idea is for users to enter a numerical value with a maximum of two decimal points (i.e. 1,234.01)

Now I'm testing this form out to see whether it'll handle any incorrect user entries - especially the scenario where a user enters some string (letters) in this field by error. When I'm testing this scenario on Acrobat Pro, any text entries will be cleared out as soon the user tabs out of the field (which is exactly what I want it to do as it only should accept numerical values).

However when testing this out in Adobe Reader (with Reader Extendability switched on), any text entries are replaced with a "0.00" when the user tabs out of the field.  Unfortunately this is not what I want .  Replacing an incorrect entry with a 0.00 is actually a misrepresentation, because 0.00 is a valid entry that the users should be allowed to enter if they want to (hope that last sentence made sense ).

Does anyone have any ideas how this can be sorted? I'm thinking this is something to do with the "Allow Empty" or the "Allow Zero" settings on the display pattern window.  But i haven't got a clue on where to start because I've never used those settings before. Any help anyone can provide me will be greatly appreciated.  Thanks. display pattern.JPG

1 Reply

Avatar

Level 6

On the decimal field(MUST BE DECIMAL FIELD object), apply the below patterns.

1. Set the display pattern as : num{zzz,zzz,zz9.99}

2. dont put any patterns on Edit and Validation Tabs

3. Set the Data pattern as: num.decimal{}

Now put the Object properties of the decimal field as:

select the check boxes of Limit Leading digits and Limit Trailling digits and place the 9 and 2 respectively on the boxes(9 and 2 derived from ur display pattern of (num{zzz,zzz,zz9.99}), can be changed to ur needs.

With the above things in place, the decimal field cannot allow any characters other than the numaricals and dot(.)

Hope this helps.