The number form field type provides a HTML5 text box with arrows. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is used. This field is available from Joomla 3.2.
Example XML field definition:
<field name="mynumbervalue" type="number" default="0" label="Choose an number" description="" min="0" max="10" step="1" />
This will create a number box with possibility to chose values between 0 and 10 and change current value by 1 each time user click up or down field button.
- type must be number.
- name is the unique name of the field.
- label (translatable) is the descriptive title of the field.
- description (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
- default (translatable) is the default value.
- class is a CSS class name for the HTML form field.
- min: this value is the lowest that can be chosen.
- max: this value is the highest that can be chosen.
- step: if user click up or down arrow current value will change by this attribute.
- filter: the filter to be used on this field value after submit.
- hint: placeholder to be set on this field.
- disabled: should this field be disabled?
- readonly: should this field be read only?
- required: should this field be required?
- autocomplete: should this field use auto complete?
- autofocus: should this field have focus when page first time loads?
- size: maximum field width in characters.