Currency Field

The currency field.

The currency field uses the JQuery Price Format plugin to render format the input as it's entered.

Properties

Title Currency
Description Provides an automatically formatted and configurable input for entering currency amounts.
Field Type currency
Base Field Type text

Schema

Property Type Default Description
allowOptionalEmpty Allows this non-required field to validate when the value is empty
autocomplete string Allows you to specify the autocomplete attribute for the underlying input control whether or not field should have autocomplete enabled.
data object Allows you to specify a key/value map of data attributes that will be added as DOM attribuets for the underlying input control. The data attributes will be added as data-{name}='{value}'.
disallowEmptySpaces boolean Whether to disallow the entry of empty spaces in the text
disallowOnlyEmptySpaces boolean Whether to disallow the entry of only empty spaces in the text
enum array List of specific values for this property
inputType string Allows for the override of the underlying HTML5 input type. If not specified, an assumed value is provided based on the kind of input control (i.e. 'text', 'date', 'email' and so forth)
maskString string Expression for the field mask. Field masking will be enabled if not empty.
placeholder string Field placeholder.
size number 40 Field size.
trim boolean Remove whitespace from the beginning and end of string
typeahead Provides configuration for the $.typeahead plugin if it is available. For full configuration options, see: https://github.com/twitter/typeahead.js

Options

Property Type Default Description
allowNegative boolean Determines if negative numbers are allowed.
centsLimit number 2 The limit of fractional digits.
centsSeparator text . The separator between whole and fractional amounts.
clearPrefix boolean Determines if the prefix is cleared on blur.
clearSuffix boolean Determines if the suffix is cleared on blur.
insertPlusSign boolean Determines if a plus sign should be inserted for positive values.
limit number -1 A limit of the length of the field.
name string Field Name.
prefix text $ The prefix if any for the field.
round string none Determines if the field is rounded. (Rounding is done when getValue is called and is not reflected in the UI)
sort function Defines an f(a,b) sort function for the array of enumerated values [{text, value}]. This is used to sort enum and optionLabels as well as results that come back from any data sources (for select and radio controls). By default the items are sorted alphabetically. Don't apply any sorting if false.
suffix text The suffix if any for the field.
thousandsSeparator string , The separator between thousands.
unmask boolean true If true then the resulting value for this field will be unmasked. That is, the resulting value will be a float instead of a string (with the prefix, suffix, etc. removed).

Requirements

ahead of its use.

Be sure to load lib/jquery-price-format2/jquery.price_format.min.js before rendering your forms. You can download JQuery Price Format from jquerypriceformat.com.

JQuery Price Format overwrites the unmask method of the JQuery Masked Input plugin. If you want to use JQuery Masked Input you should load the price format plugin before you load the masked input plugin.

Example 1

{% raw %} {% endraw %}

Example 2

{% raw %} {% endraw %}