Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input Mask for FM7 Developer

Status
Not open for further replies.

RMCDave

Programmer
Oct 28, 2004
1
US
Is it possible to put an input mask on an input field. For exemple, I want to input a phone number ;

(999) 999-9999

or a time;

99:99:99
 
Use a custom function to do that, for the tel number you could use something like:

Let( [TempNum= Filter(number; "0123456789");
//remove leading 1
Num = If(Left(tempnum;1) = 1; Middle(tempnum;2;99); tempnum);

Phone = "("& Left(num;3) &
") "& Middle(num;4;3) &
"-"& Middle(num;7;4) &
// if it exceeds a length assume it is an extension
If(Length(num)> 10; " x"&Middle(num;11;99);"")];

If(Length ( Num ) < 10;
// if number is to short less than 10 digits display it in red as error
TextColor ( phone ; RGB ( 255 ; 0 ; 0 ) );
// remove color format
TextColor ( phone ; RGB (0 ; 0 ; 0 ))))


HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top