[SOLVED] problem with phonenumbers

13 years 8 months ago #139531 by matheuspluz
Replied by matheuspluz on topic Re:problem with phonenumbers
I have a field of type (text field), where i want put a regular expression to format phone numbers, like this (xx) xxxx-xxxx. I trying, the solutions exposed in this forum but no working.

I must enable some plugin to before set a custom regex?
Or what?

OBS.: Sorry my english is very bad!:blush:

Please Log in to join the conversation.

13 years 8 months ago #139630 by krileon
Replied by krileon on topic Re:problem with phonenumbers
Nothing special is needed aside from double escaping your expression. All \ escapes must have 2 so if you used \. you'd need to use \\. in actuality. Modify your expression as you see fit.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

13 years 8 months ago #139634 by matheuspluz
Replied by matheuspluz on topic Re:problem with phonenumbers
This problem are resolved now, the solution follow:

[code:1]/^[(]?[0-9]{2}?[)]?[ ]?[0-9]{4}[-]?[0-9]{4}$/[/code:1]

The result this: (99) 9999-9999
Brazilian phone format.

Now another question, which file i must modify to activate javascript mask, like file atached

Please Log in to join the conversation.

13 years 8 months ago #139635 by matheuspluz
Replied by matheuspluz on topic Re:problem with phonenumbers
...file attached.

OBS.: Please rename to index.html

Attachment index-be4b69ddb708f99141924a4c217098b5.txt not found

Attachments:

Please Log in to join the conversation.

13 years 8 months ago #139663 by krileon
Replied by krileon on topic Re:problem with phonenumbers
Regex validation does not use JS validation, it'll PHP validate in other words it'll perform the check after the page has been saved.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

13 years 8 months ago #139688 by matheuspluz
Replied by matheuspluz on topic Re:problem with phonenumbers
You do not understand me. I know that regex validation does not use JS validation, but "I" want inser JS validation in my form of the CB, on event "onkeypress" of the my phone field, how i guess that forms do CB, are dinamic generated i want know what file is responsable for generate the fields, to insert the "tags" necessary to work this validation in JS.

Do you understand me now?

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.184 seconds

Facebook Twitter LinkedIn