I have written this code in Border color
If(!IsBlank(Phone1txt) && IsMatch(Phone1txt.Text,Digit & Digit & Digit & Digit & Digit & Digit & Digit & Digit & Digit & Digit),RGBA(32, 54, 71, 1),
If(!IsBlank(Phone1txt) && IsMatch(Phone1txt.Text,LeftParen & Digit & Digit & Digit & RightParen & Space & Digit & Digit & Digit & Hyphen & Digit & Digit & Digit & Digit,
MatchOptions.Complete),RGBA(32, 54, 71, 1),
If(!IsBlank(Phone1txt) && IsMatch(Phone1txt.Text,Digit & Digit & Digit & Space & Digit & Digit & Digit & Space & Digit & Digit & Digit & Digit,
MatchOptions.Complete),RGBA(32, 54, 71, 1),
If(!IsBlank(Phone1txt) && IsMatch(Phone1txt.Text,Digit & Digit & Digit & Space & Digit & Digit & Digit & Hyphen & Digit & Digit & Digit & Digit,
MatchOptions.Complete),RGBA(32, 54, 71, 1),
If(!IsBlank(Phone1txt) && !IsMatch(Phone1txt.Text,Digit& Digit& Digit& Hyphen& Digit& Digit& Digit& Hyphen& Digit& Digit&Digit &Digit) ,Color.Red,RGBA(32, 54, 71, 1))))))
No matter what the formatting type it should change to the format (###) ###-####
So i tried using Onchage property I have written this code: Set(varPhone,Text(Value(Phone1txt.Text),"[$-en-US]###-###-####")) and in Default i am using the variable but if the user gives 10 digits it working but when i give any other format its not working its showing an error
Advance Thanks
WarrenBelz
85
Most Valuable Professional
Michael E. Gernaey
65
Super User 2025 Season 1
mmbr1606
55
Super User 2025 Season 1