Number form field type in Standard form field types in Joomla - abdulwaheed.pk

Select your language

So if you need to draw a number type text field, like that

<input type="number" id="jform[age]" id="jform_age" value="0" step="1" />

then number form field type will do that job. It 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. Available from 

Here are its attributes:

  • type (mandatory) must be number.
  • name (mandatory) is the unique name of the field.
  • label (optional) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • default (optional) (translatable) is the default value.
  • class (optional) is a CSS class name for the HTML form field.
  • min (optional) this value is the lowest that can be chosen.
  • max (optional) this value is the highest that can be chosen.
  • step (optional) if user click up/down arrow current value will change by this attribute (this attribute value will be added or subtracted to current field value).
  • filter (optional) the filter to be used on this field value after submit.
  • hint (optional) placeholder to be set on this field.
  • disabled (optional) should this field be disabled?
  • readonly (optional) should this field be read only?
  • required (optional) should this field be required?
  • autocomplete (optional) should this field use auto complete?
  • autofocus (optional) should this field have focus when page first time loads?
  • size (optional) the maximum field width in characters.

In order to draw above mentioned input code we will use following XML field definition.

<field type="number" name="age" label="Enter Age" default="0" description="" min="1" max="120" step="1" />

 Hope this helped.


Need Joomla experts for development of custom Joomla Plugin, feel free to contact us Today


 Abdul Waheed : (Hire Joomla & PHP Pakistani Freelancer)