International phone number CB Field group

7 months 3 weeks ago #334954 by activha
Hello

I am trying to add on a single line two fields side by side to reflect international phone numbers.
The first one is a sql query to display country codes and the second is a text field with only digits validation.

Using field groups I think I can do it but how can I set the display to have both fields on a single line without table numérotation ?

Please Log in to join the conversation.

7 months 3 weeks ago #334964 by krileon
Replied by krileon on topic International phone number CB Field group
Field Groups lets you completely customize how fields are displayed using the "Custom Edit Rows" parameter under Parameters > Display. If you need 2 fields side by side you'd just use the following.

[field_FIELD1-NAME-HERE] [field_FIELD2-NAME-HERE]

Then set "Edit Field Format" to "None" or "Span". That should work.

With that said I'd probably just use a text field with custom validation and an input mask (to handle auto formatting) as both are supported on text fields.


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.

7 months 3 weeks ago #334971 by activha
Replied by activha on topic International phone number CB Field group

With that said I'd probably just use a text field with custom validation and an input mask (to handle auto formatting) as both are supported on text fields.

Yeah I was thinking at this first, but that's difficult to achieve due to the complexity of international phone numbers. I need to have a phone field in numbers only but with international country code and phone number (but without the 0)

If you have already done this, I'd be glad to have an exemple.

Please Log in to join the conversation.

7 months 3 weeks ago #334973 by krileon
Replied by krileon on topic International phone number CB Field group
The input mask would let you format it however you want and validation to validate it. I do not have an example to provide besides taking a look at that functionality in the text field and giving it a try.

The included phone number input mask doesn't support all formats though and you might need a custom one. You can use string mapping or REGEXP mapping for input masks on text fields so it's quite powerful and don't see why it couldn't accommodate your needs. Basically users would just type their phone number and it would auto format it for them.


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.

7 months 3 weeks ago #334990 by activha
Replied by activha on topic International phone number CB Field group
My issue is that I need the DB table to have a record stored like 33123456789 but that would display a mask like (33) 123 56 67 89 in the front end.

How can I achieve this ?

Please Log in to join the conversation.

7 months 3 weeks ago #334992 by krileon
Replied by krileon on topic International phone number CB Field group
Why does it need to be stored in the database as strictly an integer? Only way to do that would be to use an integer field for storage then use a Code field provided by CB Code Field for the display to format it using PHP.


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.

Moderators: beatnantkrileon
Time to create page: 0.216 seconds

Facebook Twitter LinkedIn