Format Number after exit field element?

jmoises

Active Member
I just like to know if is posible after user type some numbers in a field elelemnt and change to other element the number auto format it example:

user type: 1000 when user exit field elelemt automaticaly change to $ 1,000.00,

i know i can use some java but i was wonder if this is posible with the current settings because i have not be able to acomplish it.

Thanks
 
In the field element's "Formatting" tab, you can set it to "decimal" with separators, decimal length etc as per your needs.
More formatting can't be done in the form field (only when displaying elsewhere).
But in the form field you could "cheat", e.g. by placing a "$" currency symbol with CSS.
 
In the field element's "Formatting" tab, you can set it to "decimal" with separators, decimal length etc as per your needs.
More formatting can't be done in the form field (only when displaying elsewhere).
But in the form field you could "cheat", e.g. by placing a "$" currency symbol with CSS.

Thank you i read that the formatting using sprintf not allow to add the $, but mabe cheatting litte works, thanks i try that
 
"$ %s" should work in "Format string (sprintf)" field, but this doesn't format the value when you exit the field.

To format when the field loses focus, you would have to do the js formatting in element blur event.

And if you need "isnumeric" validation and proper numeric value added to database, you would have to add php validation with "Replace" option and remove the dollar sign etc in the validation plugin code.
 
Last edited:
To force an input format you can define a "mask" e.g. $ 9,999.99, but then the user must fill in a digit for every single "9", so it's useful for e.g. telephone numbers but not really for amounts.

"Format string" is for formatting in list and details view.

You could add the $ to the label, or via JS bofore/after the field element, or via a custom template
 
We are in need of some funding.
More details.

Thank you.

Staff online

Back
Top