I was wondering if anyone has had any issues with the
<mx:PhoneFormatter> under validPatterChars?
Here's my problem:
When a user enters a phone number like 1234567890 the
formatter works fine (###) ###-####
...but if a user enters 123-456-7890 then the formatter
doesn't nicely format the phone number?? I have even tried the
Adobe Flex example with the same results?
Anyone have any ideas. I was think of stripping everything
out first and leave just the numbers before formatting?
var rePhPat:RegExp = /[^0-9]+/ig; // Returns only the
numbers, stripping out anything else
var phstr:String = phoneIn.text; //anything like
var formatted_phoneIn:String = (phstr.replace(rePhPat, ""));
// result put back into field formatted nicely
phoneIn.text = phoneFormatter.format(formatted_phoneIn);
...where phoneFormatter was my
<mx:PhoneFormatter id="phoneFormatter" ... />