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