Bug with integers using 0 first...

15 years 3 weeks ago #93698 by crony
Bug with integers using 0 first... was created by crony
Hello,

I've defined a new integer field for a phone number.
Everything is going well except that my phone numbers starts with 0, example :

04 67 55 44 22

While saving the phone number the 0 has gone into the profile...So :

4 67 55 44 22

This is very annoying...Am I doing something wrong ? Is there a way to correct that ?

Thanks !

J! 4.x - CB 2.7.3

Please Log in to join the conversation.

15 years 3 weeks ago #93976 by krileon
Replied by krileon on topic Re:Bug with integers using 0 first...
0 is considered NULL and is generally stripped. Ensure your "Minimum value allowed:" is 0.


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.

15 years 3 weeks ago #93988 by crony
Replied by crony on topic Re:Bug with integers using 0 first...
Hello Krileon,

Considering 0 as NULL frightens me a bit... ^^

Into a custom field, I did this : allowed a size of 10 , with max Length : 10 as well.
Minimum value:0
Max value: 99 99 99 99 99

With custom PERL regular expression I've inserted:

/^[0-9]*$/

But the 0 is always gone(because he's the first number of phone number)... :(

I may use a text field, but I wanted to avoid letters into phone numbers...(yes in France, we don't use letters at all...)

Not sure if I need to customize my regexp more, or if it's a bug into CB...

Thanks for your help !

J! 4.x - CB 2.7.3

Please Log in to join the conversation.

15 years 3 weeks ago #94008 by nant
Replied by nant on topic Re:Bug with integers using 0 first...
There is no integer that starts with 0 except 0.
Integer field is working just fine.

For your case you should use text field which accepts only numbers (via perl expression)

Please Log in to join the conversation.

15 years 3 weeks ago #94033 by crony
Replied by crony on topic Re:Bug with integers using 0 first...
My mistake :whistle:

I had an error using Text field with the regexp, must have done something wrong first time...

Thank you for your answers :)

J! 4.x - CB 2.7.3

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.231 seconds

Facebook Twitter LinkedIn