• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

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.

Members online

Back
Top