Formatting telephone numbers basing on a country - codenameone

I want to format the telephone numbers to: 1) Start with +country code, 2) Format the numbers (spacing after a given number of figures) depending on the recognized country format. Any help is highly appreciated

You can check out this tutorial on phone number/country code selection: https://www.codenameone.com/blog/tip-activation-ui-builder-pattern.html
If you want separate fields for each block in the number see this https://www.codenameone.com/blog/validation-regex-masking.html specifically the auto move functionality to "jump" to the next field.

Related

How to use currency format with diffrent number format in angular js

I want to convert currency as per the regions like US , UK ,India ,Indonesia etc. and also want to convert in the number format as per region.
Example like in US $ 102,021.21 is written like this but in Indonesian format it will written something like this RP 102.021,21
So here both the number format is different. I use to convert currency using currency pipe but when I use number format with pipe one of them is not working.
this.results.records[i].totalAmount = new Intl.NumberFormat().format(this.results.records[i].totalAmount);
I used this to convert total amount to it's region's number format and currency pipe for convert amount as per currency value. But both are not working at same time. If I put them one by one then it will work. I want to do it at the same time.
Thanks in advance.
According to the following site
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat
you can pass locale and currency code to NumberFormat. So this should give you the result you want.
$scope.value=new Intl.NumberFormat('fr-fr', { style: 'currency', currency: 'EUR' }).format($scope.value);

Get letters instead of numbers in option button with Access

I was trying to design a form in access, when i was in the marital status field i think it was a good idea to use a group of option buttons but i can save letters only numbers. This is not bad but i would like to save letters because is easier to remember. I have 4 values. I have other similar fields, like sex, education and so.
You can use Choose. It returns values from input of 1 to n and Null for values outside the range. This can be used by Nz to return a value for unknown inputs.
This can be used a ControlSource for a textbox, here for values between 1 and 4:
=Nz(Choose([NameOfYourOptionBox], "Male", "Female", "Hermaphrodite", "None"), "Unknown")

Orbeon calendar behavior

when using a calendar (input with a bind to a date), is there a way to control the interpretation of the input ?
For what I've seen:
1-31 will be the nth of the current month
32-99 is n day after the first of the current month
x0y is the yth day of xth month of the current year
Then it's a little random
511950 will give 05/01/2050
but 151950 will give 01/05/2050
From what i gathered, the control tries to interpret some symbols (any symbol, this includes digits) as separators.
So for example, 151950 is 1/1/50 instead of 1/5/1950 and because it's more than 50 years, the '50' is translated as 2050 instead of 1950.
This is pretty confusing for users, specially when they explicitly put the year with 4 digits and not only 2.
So i'm looking for a way to be a lot stricter. For instance only allowing the dd/mm/yyyy format (with explicit separators). The rest would render the value invalid instead of trying to translate it in something it is not.
Is there a way to do that ?
We're using Orbeon 3.8, and our forms are mostly in french, so dd/mm order.
The parsing is done with regular expressions. See the code here. (To be fair: this code is old!)
I suspect that the overflow conditions are simply a product of the JavaScript date object.
The only way to change this behavior as far as I know is to change the JavaScript code.

Converting a percentage whole number in one field to a decimal in another field in Adobe Livecycle

I'm creating a budget template in Livecycle Designer.
I have a field where users can enter a percentage as a number (for example if you want to enter 75%, just enter 75).
I'd like another numfield box to take this number and convert it to .75
Can I do this across num fields or do I have to do it one box (where a user enters 75 and it turns into .75 automatically).
If you just want to enter integer numbers in the numeric field then that can easily be done by just taking a numeric field and then simply entering this javascript in the "exit event" of the field as:
var value1=this.rawValue;
this.rawValue="."+value1;

How not to hash part of user data in Cakephp

In my cake app user needs to submit mobile number with the registration form, I see that mobile number is automatically encrypted to some other number, how do I not encrypt part of user data ? especially the 10 digit mobile number ?
Since the database field is of type int I'm guessing the issue arises when you try to save phone numbers that are not strictly integers, i.e. +123456, 123 456 789, 00123 456, 123-456-789 etc. You must use a varchar field to store phone numbers that include spaces, hyphens, pluses or start with a zero.

Resources