(Open Source) Phone Number Auto Formatting Textfield Class

If you are interested in having a textfield that auto formats 10 Digit NANP phone numbers then you might want into this project. I also saw some work related to my project in the past (https://forum.xojo.com/32791-applying-mask-to-textfield-part-deux/0)

This is a custom class that is subclassed from TextField class in order to provide complete filtering and formatting for Phone Numbers (10 Digit NANP Only). The Phone Formatting Textfield will automatically format while the user is typing in their 10 digit phone number. All guardrails have been put into place so users ONLY type in their digits and see a nice formatted output of (XXX)XXX-XXXX automatically.

NOTE: This project in its original state does not support International number support - Only 10 Digit NANP numbers at this point. Feel free to fork this project, extend the code base, and then make a pull request if you would like to contribute.

If you find bugs please open an issues ticket at https://github.com/IntelligentVisibility/PhoneFormattingTextfield/issues.

GitHub Project:

Screen Shot:
post photo

I moved the logic code away from the custom event definition I made and abstracted it all in a method. This makes implementation easy as there is no work to do outside of instantiating the class on your window.

Originally I wanted to leave the logic obviously open for devs, but that made project implementation harder than needed.

Now just copy the class into your project and instantiate on a window/Container. Thats it.