I couldn't find something like this so wrote it myself.
This currency plugin plugs in to a xtype: 'textfield' like so:
It kinda speaks for itself I guess.. Here's a screenprint of what the demo (included in zip) looks like if your run it.
fieldLabel: 'Currency demo',
currencySymbol: '\u20AC', // = euro sign in unicode
invalidAmountText: 'Not a valid amount.'
The plugin creates a copy of the textfield with the same name (removes name property from original) so when you submit a currency field, the value is always sent as a float (submit decimal separator is a dot)
Two things to remember:
- the plugin only works on a Ext.form.TextField !
- use unique names for your textfields.
Update: Current version respects values set with the setValue() method. In other words, should work fine when (pre)loading a form with existing values from a backend for instance.