Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Decimal Field Error

Avatar

Level 4

Dear All,

I had a decimal field with following properties:

1)      Width = 0.5 mm

2)      Limit Leading Digits as blank

3)      Limit Trailing Digits as 5

I need to restrict the user to enter only 15 characters including a period (.) and the number of leading digits between 0 and 5. This means the possible values are possible:

Ø      123.45658

Ø      123.152

Ø      123456789

Ø      1234555555.12 and so on

I’m able to achieve this by adding the following script on the change event of the field:

if(xfa.event.fullText.length > 15)

{

   xfa.event.change = "";

}

But the problem is, since the width of my field is only 0.5 mm, I can only see 7 or 8 characters and the remaining characters are getting cut off. What changes I could make to see all the characters in the field at a time?

Please Note:

  1. I don’t want to change the width of the field.
  2. There is no option like “Allow Multiple Lines” for a decimal field.
  3. Since only a text box has “Allow Multiple Lines” option, if I use a text field instead, how should I achieve the above stated validation? Any script or pattern to achieve the same? (Validation to check only numbers are entered, not more than 5 digits are entered after the decimal point, the total number of digits are not more than 15 including after decimal part if any)

Thanks,

VJ

0 Replies

Avatar

Level 4

Any help towards this would be highly appreciated.

Thanks,

VJ

Avatar

Level 7

I'm not sure if this is what you're looking for, but you could set the font size to '0' in the Object Palette. That will cause the font to shrink as you type. more characters than the box can handle.

A word of warning, at about 12 characters, it gets difficult to read on a smaller monitor or on a page that is not zoomed in.