Regular Expression for Phone Number

User 2140875 Photo


Registered User
378 posts

I'd like to be able to have the user type in a 10 digit phone number and have it automatically formatted to (xxx) xxx-xxxx.

User inputs 1234567890 and field displays (123) 456-7890

I can find a reg expression that validates, but nothing that converts.

Can anyone help with this.

Thanks.
User 2088758 Photo


Senior Advisor
3,121 posts

I don't believe there is Galen. It would be a great enhancement to the wfb though.
Taking over the world one website at a time!

Steve Kolish
www.misterwebguy.com

YouTube Channel:
https://www.youtube.com/channel/UCL8qVv … ttneYaMSJA
User 2147626 Photo


Ambassador
2,958 posts

Actually, there may be help... check out this...
http://gunsmoke.me/cloud/graphics/phoneformat1.jpg

The reference URL is: http://www.htmlgoodies.com/html5/tutori … WzXEI_rBL7
Graphics for the web, email, blogs and more!
-------------------------------------
https://sadduck.com
User 187934 Photo


Senior Advisor
20,271 posts
Online Now

Maybe this.:)
http://ericrohloff.com/coffeecup/ccforu … neconvert/
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2140875 Photo


Registered User
378 posts

Thanks to both of you. I will give that a try.
Galen
User 2088758 Photo


Senior Advisor
3,121 posts

how did you do that Eric?
Taking over the world one website at a time!

Steve Kolish
www.misterwebguy.com

YouTube Channel:
https://www.youtube.com/channel/UCL8qVv … ttneYaMSJA
User 187934 Photo


Senior Advisor
20,271 posts
Online Now

I put the instructions on there.;)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 516429 Photo


Registered User
83 posts

I tried this demo and if I made a error inputting the number I am unable to back up to make changes to the number. Would there be a way to allow it? I was using a mobile device at the time.
Thanks!

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.