This is a wrapper around {{calculator}} to add codex style text input formatting. See https://doc.wikimedia.org/codex/latest/components/demos/text-input.html#guidelines for best practices when using this template.
See {{calculator}} for details on how this works. This template requires the Calculator gadget to be enabled.
If using a label, you should set the codex
parameter to {{calculator label}}
{{Calculator label|codex=true|description=Short description text|label=Label text|for=foo}} {{calculator codex text|default=42|id=foo}}
Add a codex-themed text input box widget to the page for use with the calculator gadget.
Parameter | Description | Type | Status | |
---|---|---|---|---|
id | id | The id for this input. This is used to reference it in formula of other calculator templates | String | required |
formula | formula | Formula to calculate this field
| String | suggested |
readonly | readonly | Make input box readonly to user input | Boolean | optional |
size | size | Size of input box (How many characters it will fit) | Number | optional |
placeholder | placeholder | The placeholder text provides an example of what type of information is being requested in the input. The placeholder text should further illustrate and support the text input label. However, it should never be the only input description. | String | optional |
default | default | Default value for this field | String | suggested |
style | style | CSS to style the input element with | String | optional |
precision | precision | Format to this many significant digits, using decimal notation except for really large numbers [Only applies to type=number or type=plain]
| Number | optional |
exponential-precision | exponential-precision | Format to this many significant digits, using scientific notation [Only applies to type=number or type=plain]
| Number | optional |
decimals | decimals | Format to a fixed number of decimal digits [Only applies to type=number or type=plain]
| Number | optional |
NaN-text | NaN-text | Use this text instead of NaN to signify "not a number". Only applies to format=plain or format=text. Plaintext only; wikitext is not supported
| String | optional |
class | class | CSS classes to add | String | optional |
class-live | class-live | CSS class to add only if gadget is active on the page | String | optional |
error | error | Mark this field as having invalid input | Boolean | optional |
codex-div-class | codex-div-class | Additional css classes to apply to the outer div | String | optional |