These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Limit entry within a Numeric Field

tgoodman
Registered: Aug 18 2008
Posts: 72
Answered

Hi,

In LiveCycle Forms, I'm using a Numeric field, but I want to limit the number of (numeric) characters entered.

The Text field has a limit length property, but the Numeric Field does not seem to have a corresponding property (other than Limit length to Visible Area).

I can perform a javascript pop-up validation, but this is a much less usable solution to just limiting the entry.

Is there no event that I can use to have a field, limit to 4 numeric characters?

Should I log this with Adobe as a 'feature request'?

Thanks

Helen_Dyksley
Registered: Jun 4 2007
Posts: 27
Hi, there is a way, via script, to limit a numeric field to 4 characters. The method below works with Designer 7.1.

With JavaScript, on the Change event try this:

if (xfa.event.newText > 9999) {
xfa.event.change = "";
}

If the user enters more than 4 characters, it removes the last character(s) entered. Remember, the code is case sensitive. (If you want to limit the field to three characters, type in 999 instead.)
tgoodman
Registered: Aug 18 2008
Posts: 72
Thanks - that's exactly what I was looking for
scotl578
Registered: Jun 6 2011
Posts: 5
I am unable to limit the numbers entered into a numeric field
ktatsch
Registered: Jun 23 2011
Posts: 1
I'm using Acrobat 9 and defined a numeric field with a limit of 17 numbers (bank account number limit length).
Setting: 0 decimal and no separators.

When I type a 17th number and advance to the next field, the number rounds up or down, using the mathematical rule for rounding (e.g., number ending in 65 is 64 and number ending in 75 is 76. When I return to the field, it shows the correct number, but does not display it when printed or when the cursor is not in the field.

I do not know what they rounding is occurring. If I expand the limit to 20, it still rounds the 17th digit and everything after is zero. Is this some limit in acrobat for numbers, or is it something I can control? I cannot find anything on it.
tgoodman
Registered: Aug 18 2008
Posts: 72
If you are entering an Account number, then I would suggest that this is not a Numeric field, but Numeric Text.

I recommend using a Text field and limit the entry to Numeric characters.
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
If you are entering a very long number, more than 16 characters, you are encountering the limits of floating point numbers.

As noted you want to use a text field and then you will need to provide a special format image to allow entry of numeric values and possibly allowing leading zeros.

George Kaiser