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

SOLVED

getting number of digits from a decimal field

Avatar

Level 3

I'm relative new to scripting and i don't know how to do this.

I have a telephone field with the right format and a limit of 10 numbers.

But how do i check if the user enters less than 10 numbers.

And present them a message when they do

1 Accepted Solution

Avatar

Correct answer by
Level 10

This is one approach.

var phoneStr = form1.page1.subform1.telephone.rawValue;

if (phoneStr.length < 10) {

  xfa.host.messageBox("The telephone number must be a minimum of 10 digits.","Telephone Number",1);

}

Steve

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

This is one approach.

var phoneStr = form1.page1.subform1.telephone.rawValue;

if (phoneStr.length < 10) {

  xfa.host.messageBox("The telephone number must be a minimum of 10 digits.","Telephone Number",1);

}

Steve