Standard form field types/Single-page reference

From Joomla! Documentation

< Standard form field types
Revision as of 14:13, 1 July 2015 by MATsxm (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This page lists all documented form field types together. Use the printable version of this page to print this reference.

Accesslevel form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Accesslevel Field instead


Provides a dropdown list of accesslevel options with the current option selected.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be accesslevel.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field.
  • class additional classes to set style.
  • multiple (optional) is whether multiple items can be selected at the same time (true or false).
  • useglobal (optional) if set to true, it will show the value that is set in the global configuration if found in the database.

Implemented by: libraries/joomla/form/fields/access.php

Example XML Definition:

<field name="access" type="accesslevel"
	label="JFIELD_ACCESS_LABEL"
	description="JFIELD_ACCESS_DESC"
	class="span12 small" />

Accesslevel form field type/bn[edit]

বর্তমান বিকল্পটি নির্বাচিত সঙ্গে accesslevel বিকল্পগুলির একটি ড্রপডাউন তালিকা প্রদান করে।

  • নাম (বাধ্যতামূলক) প্যারামিটারের অনন্য নাম।
  • টাইপ (বাধ্যতামূলক) অ্যাক্সেসলেভেল হতে হবে।
  • লেবেল(বাধ্যতামূলক) (অনুবাদযোগ্য) ক্ষেত্রের বর্ণনামূলক শিরোনাম।
  • বিবরণ ফর্ম ক্ষেত্রের জন্য বিবরণ টেক্সট।
  • ক্লাস স্টাইল সেট করার জন্য অতিরিক্ত ক্লাস।
  • multiple (optional) is whether multiple items can be selected at the same time (true or false).
  • useglobal (optional) if set to true, it will show the value that is set in the global configuration if found in the database.

দ্বারা বাস্তবায়িত: libraries/joomla/form/fields/access.php

উদাহরণ XML সংজ্ঞা:

<field name="access" type="accesslevel"
	label="JFIELD_ACCESS_LABEL"
	description="JFIELD_ACCESS_DESC"
	class="span12 small" />

Accesslevel form field type/en[edit]

Provides a dropdown list of accesslevel options with the current option selected.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be accesslevel.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field.
  • class additional classes to set style.
  • multiple (optional) is whether multiple items can be selected at the same time (true or false).
  • useglobal (optional) if set to true, it will show the value that is set in the global configuration if found in the database.

Implemented by: libraries/joomla/form/fields/access.php

Example XML Definition:

<field name="access" type="accesslevel"
	label="JFIELD_ACCESS_LABEL"
	description="JFIELD_ACCESS_DESC"
	class="span12 small" />

Accesslevel form field type/fa[edit]

Provides a dropdown list of accesslevel options with the current option selected.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be accesslevel.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field.
  • class additional classes to set style.
  • multiple (optional) is whether multiple items can be selected at the same time (true or false).
  • useglobal (optional) if set to true, it will show the value that is set in the global configuration if found in the database.

Implemented by: libraries/joomla/form/fields/access.php

Example XML Definition:

<field name="access" type="accesslevel"
	label="JFIELD_ACCESS_LABEL"
	description="JFIELD_ACCESS_DESC"
	class="span12 small" />

Accesslevel form field type/zh-tw[edit]

提供存取權限層級的下拉清單選項

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be accesslevel.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field.
  • class additional classes to set style.
  • multiple (optional) is whether multiple items can be selected at the same time (true or false).
  • useglobal (optional) if set to true, it will show the value that is set in the global configuration if found in the database.

Implemented by: libraries/joomla/form/fields/access.php

範例 XML Definition:

<field name="access" type="accesslevel"
	label="JFIELD_ACCESS_LABEL"
	description="JFIELD_ACCESS_DESC"
	class="span12 small" />

Cachehandler form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Cachehandler Field instead


Provides a list of available cache handling options.

  • type (mandatory) must be cachehandler.
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field.
  • filter filter to apply, normally use "word".

Example XML Definition:

<field name="cache_handler"
 	type="cachehandler"
 	default=""
 	label="COM_CONFIG_FIELD_CACHE_HANDLER_LABEL"
 	description="COM_CONFIG_FIELD_CACHE_HANDLER_DESC"
 	filter="word">
</field>

Cachehandler form field type/en[edit]

Provides a list of available cache handling options.

  • type (mandatory) must be cachehandler.
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field.
  • filter filter to apply, normally use "word".

Example XML Definition:

<field name="cache_handler"
 	type="cachehandler"
 	default=""
 	label="COM_CONFIG_FIELD_CACHE_HANDLER_LABEL"
 	description="COM_CONFIG_FIELD_CACHE_HANDLER_DESC"
 	filter="word">
</field>

Calendar form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Calendar Field instead


The calendar form field type provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value. If the field has a saved value this is shown in the text box. Otherwise the default value, if any, is displayed.

DatePicker1.calendar-en.png
  • type (mandatory) must be calendar.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) is the default date. This must be given in the same format as specified by the format argument. You can put "NOW" to have current date or time information in the given format. You can also used any [JDate arguments] ('now +1 month', 'now +2 months +7 days +12 hours', ...)
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the text box.
  • readonly (optional) is whether the text box is read-only (true or false). If the text box is read-only, the date cannot be changed, but can be selected and copied. No calendar icon will be shown.
  • disabled (optional) is whether the text box is disabled (true or false). If the text box is disabled, the date cannot be changed, selected or copied.
  • class (optional) is a CSS class name for the HTML form field. It is recommended to use the "Bootstrap2 Relatives sizing" (see code examples below).
  • format (optional) is the date format to be used. This is in the format used by PHP to specify date string formats (see below). If no format argument is given, '%Y-%m-%d' is assumed (giving dates like '2017-05-15'). If showtime is true then you will need to include some time fields, for example, '%Y-%m-%d %H:%i:%s'.
  • filter (optional) is time zone to be used. There are two main values: server_utc and user_utc. The first one is server time zone and the later is user time zone as configured in global configuration and user information respectively. There is also a value of none which must be used if the server time zone is set to something other than UTC and showtime is false.
  • translateformat (optional): If set to true, the calendar will use the DATE_FORMAT_CALENDAR_DATE language key (if showtime is true) or DATE_FORMAT_CALENDAR_DATETIME (if showtime is false) to determine the format. The format attribute is ignored. If false, the format attribute is used (same behaviour as prior to 3.7.0) but note that the format string must include time fields for the time to be recorded. Defaults to false.
  • showtime (optional): If set to true and translateformat is true, the language key DATE_FORMAT_CALENDAR_DATETIME is used, otherwise DATE_FORMAT_CALENDAR_DATE. (starting with 3.7.0). Defaults to false.
  • timeformat (optional): can be set to 12 or 24 (starting with 3.7.0). If set to 12, an additional selection is available to the user to choose between AM and PM. This attribute does not affect how the date/time is saved. Defaults to 24.
  • singleheader (optional): if set to false, the year and the month selection will be set on two separates lines, with independent selection (starting with 3.7.0). Defaults to false.
  • todaybutton (optional): if set to true, a button is added at the bottom of the date picker to select the date of the current day (starting with 3.7.0). Defaults to true.
  • weeknumbers (optional): if set to true, a column is added at the left of the date picker to display the number of the week in the current year (starting with 3.7.0). Defaults to true.
  • filltable (optional): if set to true, dates of the previous and next month are added at the top and bottom of the current month to fill the grid (starting with 3.7.0). Defaults to true.
  • minyear (optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative lower limit for the year selection. The user cannot select a year before this limit (starting with 3.7.0). If zero, which is the default, there is no limit.
  • maxyear (optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative upper limit for the year selection. The user cannot select a year after this limit (starting with 3.7.0). If zero, which is the default, there is no limit.


Example for a light DatePicker XML field definition:

<field name="mycalendar" type="calendar" default="2017-05-15" label="Select a date" description=""
	class="input-small" required="true" filter="user_utc"
	showtime="false" todaybutton="false" filltable="false" translateformat="true" />
DatePicker1.calendar-en.png

Example for an advanced DatePicker XML field definition:

<field name="mycalendar" type="calendar" default="2017-05-15" label="Select a date" description=""
	class="input-medium" required="true" filter="user_utc" format="%Y-%m-%d %H:%i:%s"
	singleheader="true" showtime="true" timeformat="12" todaybutton="true" weeknumbers="true"
	filltable="true" minyear="-3" maxyear="5" />
DatePicker2.calendar-en.png

The format attribute specifies the format that the date string will be saved in. It is also the format that manually entered dates need to be enterered in; except that the punctuation character is ignored. The coding scheme used to specify date formats is a custom one defined for the javascript library used in the datepicker, full details of which can be found for example on Joomla's Github. The following are some of the most frequently used date string codes:

Character Description Example
d Day of the month, 2 digits with leading zeros 01 to 31
a A textual representation of a day, three letters Mon through Sun
e Day of the month without leading zeros 1 to 31
A A full textual representation of the day of the week Monday through Sunday
w Numeric representation of the day of the week 0 (for Sunday) through 6 (for Saturday)
j The day of the year (starting from 0) 001 through 366
B A full textual representation of a month January through December
m Numeric representation of a month, with leading zeros 01 through 12
b A short textual representation of a month, three letters Jan through Dec
Y A full numeric representation of a year, 4 digits 1999 or 2003
y A two-digit representation of a year 99 or 03
P Lowercase Ante Meridiem or Post Meridiem am or pm
p Uppercase Ante Meridiem or Post Meridiem AM or PM

Note: The format in which dates are stored in the params.ini file is that specified by the format argument. Since there can be language-dependent elements to this format (for example, the '%A' specifier), you need to be careful not to use such elements if there is a possibility that the front-end and back-end languages may be different.

Note: The calendar form field type does not support non-Gregorian calendars. If you need to support non-Gregorian calendars then you will need to create a custom form field type to support your calendar.

Standard associated filters[edit]

  • user_utc - Calculates the specified value to the time of Greenwich, according to the user time zone settings.

See also[edit]

Calendar form field type/en[edit]

The calendar form field type provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value. If the field has a saved value this is shown in the text box. Otherwise the default value, if any, is displayed.

DatePicker1.calendar-en.png
  • type (mandatory) must be calendar.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) is the default date. This must be given in the same format as specified by the format argument. You can put "NOW" to have current date or time information in the given format. You can also used any [JDate arguments] ('now +1 month', 'now +2 months +7 days +12 hours', ...)
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the text box.
  • readonly (optional) is whether the text box is read-only (true or false). If the text box is read-only, the date cannot be changed, but can be selected and copied. No calendar icon will be shown.
  • disabled (optional) is whether the text box is disabled (true or false). If the text box is disabled, the date cannot be changed, selected or copied.
  • class (optional) is a CSS class name for the HTML form field. It is recommended to use the "Bootstrap2 Relatives sizing" (see code examples below).
  • format (optional) is the date format to be used. This is in the format used by PHP to specify date string formats (see below). If no format argument is given, '%Y-%m-%d' is assumed (giving dates like '2017-05-15'). If showtime is true then you will need to include some time fields, for example, '%Y-%m-%d %H:%M:%S'.
  • filter (optional) is time zone to be used. There are two values; server_utc and user_utc. The first one is server time zone and the later is user time zone as configured in global configuration and user information respectively.
  • translateformat (optional): If set to true, the calendar will use the DATE_FORMAT_CALENDAR_DATE language key (if showtime is true) or DATE_FORMAT_CALENDAR_DATETIME (if showtime is false) to determine the format. The format attribute is ignored. If false, the format attribute is used (same behaviour as prior to 3.7.0) but note that the format string must include time fields for the time to be recorded. Defaults to false.
  • showtime (optional): If set to true and translateformat is true, the language key DATE_FORMAT_CALENDAR_DATETIME is used, otherwise DATE_FORMAT_CALENDAR_DATE. (starting with 3.7.0). Defaults to false.
  • timeformat (optional): can be set to 12 or 24 (starting with 3.7.0). If set to 12, an additional selection is available to the user to choose between AM and PM. This attribute does not affect how the date/time is saved. Defaults to 24.
  • singleheader (optional): if set to false, the year and the month selection will be set on two separates lines, with independent selection (starting with 3.7.0). Defaults to false.
  • todaybutton (optional): if set to true, a button is added at the bottom of the date picker to select the date of the current day (starting with 3.7.0). Defaults to true.
  • weeknumbers (optional): if set to true, a column is added at the left of the date picker to display the number of the week in the current year (starting with 3.7.0). Defaults to true.
  • filltable (optional): if set to true, dates of the previous and next month are added at the top and bottom of the current month to fill the grid (starting with 3.7.0). Defaults to true.
  • minyear (optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative lower limit for the year selection. The user cannot select a year before this limit (starting with 3.7.0). If zero, which is the default, there is no limit.
  • maxyear (optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative upper limit for the year selection. The user cannot select a year after this limit (starting with 3.7.0). If zero, which is the default, there is no limit.


Example for a light DatePicker XML field definition:

<field name="mycalendar" type="calendar" default="2017-05-15" label="Select a date" description=""
	class="input-small" required="true" filter="user_utc"
	showtime="false" todaybutton="false" filltable="false" translateformat="true" />
DatePicker1.calendar-en.png

Example for an advanced DatePicker XML field definition:

<field name="mycalendar" type="calendar" default="2017-05-15" label="Select a date" description=""
	class="input-medium" required="true" filter="user_utc" format="%Y-%m-%d %H:%M:%S"
	singleheader="true" showtime="true" timeformat="12" todaybutton="true" weeknumbers="true"
	filltable="true" minyear="-3" maxyear="5" />
DatePicker2.calendar-en.png

The format attribute specifies the format that the date string will be saved in. It is also the format that manually entered dates need to be enterered in; except that the punctuation character is ignored. The coding scheme used to specify date formats is a custom one defined for the javascript library used in the datepicker, full details of which can be found for example on Joomla's Github. The following are some of the most frequently used date string codes:

Character Description Example
d Day of the month, 2 digits with leading zeros 01 to 31
a A textual representation of a day, three letters Mon through Sun
e Day of the month without leading zeros 1 to 31
A A full textual representation of the day of the week Monday through Sunday
w Numeric representation of the day of the week 0 (for Sunday) through 6 (for Saturday)
j The day of the year (starting from 0) 001 through 366
B A full textual representation of a month January through December
m Numeric representation of a month, with leading zeros 01 through 12
b A short textual representation of a month, three letters Jan through Dec
Y A full numeric representation of a year, 4 digits 1999 or 2003
y A two-digit representation of a year 99 or 03
P Lowercase Ante Meridiem or Post Meridiem am or pm
p Uppercase Ante Meridiem or Post Meridiem AM or PM

Note: The format in which dates are stored in the params.ini file is that specified by the format argument. Since there can be language-dependent elements to this format (for example, the '%A' specifier), you need to be careful not to use such elements if there is a possibility that the front-end and back-end languages may be different.

Note: The calendar form field type does not support non-Gregorian calendars. If you need to support non-Gregorian calendars then you will need to create a custom form field type to support your calendar.

Standard associated filters[edit]

  • user_utc - Calculates the specified value to the time of Greenwich, according to the user time zone settings.

See also[edit]

Captcha form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Captcha Field instead


Provides the use of a captcha plugin.

  • type (mandatory) must be captcha.
  • name (mandatory) is the unique name of the field.
  • validate (mandatory) must be captcha.
  • label (mandatory) (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.
  • namespace (optional) this is used on the com_contact component but I don't know enough about it to comment.

Example XML Definition:

<field name="captcha" type="captcha" validate="captcha"
	namespace="contact"
	label="COM_CONTACT_CAPTCHA_LABEL"
	description="COM_CONTACT_CAPTCHA_DESC" >
</field>

Captcha form field type/en[edit]

Provides the use of a captcha plugin.

  • type (mandatory) must be captcha.
  • name (mandatory) is the unique name of the field.
  • validate (mandatory) must be captcha.
  • label (mandatory) (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.
  • namespace (optional) this is used on the com_contact component but I don't know enough about it to comment.

Example XML Definition:

<field name="captcha" type="captcha" validate="captcha"
	namespace="contact"
	label="COM_CONTACT_CAPTCHA_LABEL"
	description="COM_CONTACT_CAPTCHA_DESC" >
</field>

Category form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Category Field instead


The category form field type provides a drop down list of all published categories for a certain extension. If the parameter has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected. If the show_root attribute is 1, the first option on the list will be a string representing the root category (which is a translatable string) and is given the value 0.

Params.category.jpg
  • type (mandatory) must be category.
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • extension (mandatory) is the name of the extension for which the categories will be retrieved. For example, to list content categories, use the value 'com_content'.
  • scope (optional) is an alias for extension.
  • show_root (optional) is whether a choice representing the root category will be shown.
  • default (optional) is the default category ID number.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'inputbox'.
  • published (optional) (1/0/2/-2) is whether the drop down will show only published (1), unpublished (0), archived (2) or trashed (-2) categories. It is possible to combine different publishing status by entering the list of the corresponding numbers separated by comma (e.g. "0,2,-2" will display only unpublished, archived and trashed categories in the drop-down).
  • multiple (optional) (true/false) is the ability to add more than 1 category to the form field

Implemented by libraries/legacy/form/field/category.php.

Example XML parameter definition:

<field name="mycategory" type="category" extension="com_content" label="Select a category" description="" />


See also[edit]

Category form field type/en[edit]

The category form field type provides a drop down list of all published categories for a certain extension. If the parameter has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected. If the show_root attribute is 1, the first option on the list will be a string representing the root category (which is a translatable string) and is given the value 0.

Params.category.jpg
  • type (mandatory) must be category.
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • extension (mandatory) is the name of the extension for which the categories will be retrieved. For example, to list content categories, use the value 'com_content'.
  • scope (optional) is an alias for extension.
  • show_root (optional) is whether a choice representing the root category will be shown.
  • default (optional) is the default category ID number.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'inputbox'.
  • published (optional) (1/0/2/-2) is whether the drop down will show only published (1), unpublished (0), archived (2) or trashed (-2) categories. It is possible to combine different publishing status by entering the list of the corresponding numbers separated by comma (e.g. "0,2,-2" will display only unpublished, archived and trashed categories in the drop-down).
  • multiple (optional) (true/false) is the ability to add more than 1 category to the form field

Implemented by libraries/legacy/form/field/category.php.

Example XML parameter definition:

<field name="mycategory" type="category" extension="com_content" label="Select a category" description="" />


See also[edit]

Checkbox form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Checkbox Field instead


The checkbox form field type provides a single checkbox. If the parameter has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

  • type (mandatory) must be checkbox
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • value (optional) is the value of the parameter if this checkbox is set (usually 1).
  • checked (optional) should be set to 1 to check the checkbox by default or 0 not to.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the label.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'inputbox'.

Example XML field definition:

<field name="show_title" type="checkbox" label="Show title" description="Show the title of the item" value="1" />

Example XML field definition (checked):

<field name="show_title" type="checkbox" label="Show title" description="Show the title of the item" value="1" checked="1" />


Stop hand nuvola.svg.png
Warning!

Special care needs to be taken with saving a checkbox from a form!! This is a common mistake.
You see, on saving a form with a checkbox that is unchecked, there is no variable for it in the POST information and joomla does not take care of that yet!
See Discussion on this page for more.

See also[edit]

Checkbox form field type/en[edit]

The checkbox form field type provides a single checkbox. If the parameter has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

  • type (mandatory) must be checkbox
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • value (optional) is the value of the parameter if this checkbox is set (usually 1).
  • checked (optional) should be set to 1 to check the checkbox by default or 0 not to.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the label.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'inputbox'.

Example XML field definition:

<field name="show_title" type="checkbox" label="Show title" description="Show the title of the item" value="1" />

Example XML field definition (checked):

<field name="show_title" type="checkbox" label="Show title" description="Show the title of the item" value="1" checked="1" />


Stop hand nuvola.svg.png
Warning!

Special care needs to be taken with saving a checkbox from a form!! This is a common mistake.
You see, on saving a form with a checkbox that is unchecked, there is no variable for it in the POST information and joomla does not take care of that yet!
See Discussion on this page for more.

See also[edit]

Checkboxes form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Checkboxes Field instead


The checkboxes form field type provides a set of checkboxes.
Note: unlike most standard form field types, such as textfield or checkbox, this field is not an "out of the box" solution. It will create checkboxes for you, and submit their values in form of an array, but it will not store them in the database. Example:

<field name="toppings" type="checkboxes">
    <option value="anch">Anchovies</option>
    <option value="chor">Chorizo</option>
    <option value="on">Onions</option>
    <option value="mush">Mushrooms</option>
</field>

The set of checkboxes can be generated in your form with a single statement like this:

<?php echo $this->form->getInput('toppings'); ?>

This will generate the following HTML, which can be styled using CSS:

<fieldset id="jform_toppings" class="checkboxes">
	<ul>
		<li><input type="checkbox" id="jform_toppings0"
			name="jform[toppings][]" value="anch" /><label for="jform_toppings0">Anchovies</label></li>
		<li><input type="checkbox" id="jform_toppings1"
			name="jform[toppings][]" value="chor" /><label for="jform_toppings1">Chorizo</label></li>
		<li><input type="checkbox" id="jform_toppings2"
			name="jform[toppings][]" value="on" /><label for="jform_toppings2">Onions</label></li>
		<li><input type="checkbox" id="jform_toppings3"
			name="jform[toppings][]" value="mush" /><label for="jform_toppings3">Mushrooms</label></li>
	</ul>
</fieldset>

If the user checks the second and fourth item and submits the form, the Joomla server will provide the following result:

print_r(JRequest::getVar('jform')['toppings']) =>

Array
(
    [0] => chor
    [1] => mush
)

Checkboxes form field type/en[edit]

The checkboxes form field type provides a set of checkboxes.
Note: unlike most standard form field types, such as textfield or checkbox, this field is not an "out of the box" solution. It will create checkboxes for you, and submit their values in form of an array, but it will not store them in the database. Example:

<field name="toppings" type="checkboxes">
    <option value="anch">Anchovies</option>
    <option value="chor">Chorizo</option>
    <option value="on">Onions</option>
    <option value="mush">Mushrooms</option>
</field>

The set of checkboxes can be generated in your form with a single statement like this:

<?php echo $this->form->getInput('toppings'); ?>

This will generate the following HTML, which can be styled using CSS:

<fieldset id="jform_toppings" class="checkboxes">
	<ul>
		<li><input type="checkbox" id="jform_toppings0"
			name="jform[toppings][]" value="anch" /><label for="jform_toppings0">Anchovies</label></li>
		<li><input type="checkbox" id="jform_toppings1"
			name="jform[toppings][]" value="chor" /><label for="jform_toppings1">Chorizo</label></li>
		<li><input type="checkbox" id="jform_toppings2"
			name="jform[toppings][]" value="on" /><label for="jform_toppings2">Onions</label></li>
		<li><input type="checkbox" id="jform_toppings3"
			name="jform[toppings][]" value="mush" /><label for="jform_toppings3">Mushrooms</label></li>
	</ul>
</fieldset>

If the user checks the second and fourth item and submits the form, the Joomla server will provide the following result:

print_r(JRequest::getVar('jform')['toppings']) =>

Array
(
    [0] => chor
    [1] => mush
)

ChromeStyle form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual ChromeStyle Field instead


provides a dropdown list of style options with the current option selected.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be chromestyle.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field.

Example XML Definition:

<field name="style" type="chromestyle"
	label="COM_MODULES_FIELD_MODULE_STYLE_LABEL"
	description="COM_MODULES_FIELD_MODULE_STYLE_DESC" />

ChromeStyle form field type/en[edit]

provides a dropdown list of style options with the current option selected.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be chromestyle.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field.

Example XML Definition:

<field name="style" type="chromestyle"
	label="COM_MODULES_FIELD_MODULE_STYLE_LABEL"
	description="COM_MODULES_FIELD_MODULE_STYLE_DESC" />

Color form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Color Field instead


Provides a color picker. Enter the color as #ff00ff or pick it from the palet.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be color.
  • default (optional) provides a color when not set.
  • format (optional) allows you to select the type of colour format, you can select rgb, rgba, hex.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) tooltip for the form field.

Example XML Definition:

<field name="backgroundcolor" type="color" default="#eee" format="rgba"
	label="TPL_BEEZ3_FIELD_HEADER_BACKGROUND_COLOR_LABEL"
	description="TPL_BEEZ3_FIELD_HEADER_BACKGROUND_COLOR_DESC" />

Combo form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Combo Field instead


Provides a combobox field, which offers a list like the List Form Field Type, but additionally allows free text.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be combo.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) tooltip for the form field.
  • class (optional) specify your own classes for additonal markup, defaults to "combobox".
  • readonly (optional) set to "true", meaning not editable, defaults to false.
  • disabled (optional) set to "true", meaning not enabled, defaults to false.
  • size (optional) sets the input size of the field.
  • required (optional) sets whether input is required, defaults to no input required.
<field name="myeditbox" type="combo" label="MyEditBox" description="myeditbox_Desc" size="7">
  <option value="1">Option 1</option>
  <option value="2">Option 2</option>
</field>

Combo form field type/en[edit]

Provides a combobox field, which offers a list like the List Form Field Type, but additionally allows free text.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be combo.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) tooltip for the form field.
  • class (optional) specify your own classes for additonal markup, defaults to "combobox".
  • readonly (optional) set to "true", meaning not editable, defaults to false.
  • disabled (optional) set to "true", meaning not enabled, defaults to false.
  • size (optional) sets the input size of the field.
  • required (optional) sets whether input is required, defaults to no input required.
<field name="myeditbox" type="combo" label="MyEditBox" description="myeditbox_Desc" size="7">
  <option value="1">Option 1</option>
  <option value="2">Option 2</option>
</field>

Componentlayout form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Componentlayout Field instead


The componentlayout form field type provides a drop down list of all available layouts for a view of an extension. If the parameter has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

  • type (mandatory) must be componentlayout.
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • extension (mandatory) is the name of the extension for which the layouts will be retrieved (e.g. 'com_content').
  • view (mandatory) is the name of the view for which the layouts will be retrieved (e.g. 'article').
  • useglobal (optional).
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.

Example XML parameter definition:

<field name="mylayout" type="componentlayout" extension="com_content" view="article" label="JFIELD_ALT_LAYOUT" useglobal="true" description="JFIELD_ALT_COMPONENT_LAYOUT" />

See also[edit]

Componentlayout form field type/de[edit]

Das componentlayout formularfeld bietet eine Dropdown Liste aller möglichen Layouts einer Erweiterung. Wenn es einen gespeicherten Wert gibt wird dieser asgewählt, wenn die Seite geladen wird. Wenn nicht, wird der Standardwert (falls definiert) gewählt.

type (notwendig") muss "Komponentenlayout" sein.

  • name (notwenig) ist der eindeutige Name des Parameters.
  • label (notwendig) (übersetzbar) ist der beschreibende Titel des Feldes.

extension(notwendig) ist der Name der Erweiterung für die das Layout abgerufen wird. (z.B. 'com_content') view (notwendig) ist der Name der Ansicht, für die das Layout abgerufen wird. (z.B. 'Artikel').

  • useglobal (optional).
  • Beschreibung (optional) (übersetzbar) ist der Text, der als Tooltip als Mouse-over Effekt über die Dropdown-Box angezeigt wird.

Beispiel XML-Parameterdefinitionen:

<field name="mylayout" type="componentlayout" extension="com_content" view="article" label="JFIELD_ALT_LAYOUT" useglobal="true" description="JFIELD_ALT_COMPONENT_LAYOUT" />

See also[edit]

Componentlayout form field type/en[edit]

The componentlayout form field type provides a drop down list of all available layouts for a view of an extension. If the parameter has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

  • type (mandatory) must be componentlayout.
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • extension (mandatory) is the name of the extension for which the layouts will be retrieved (e.g. 'com_content').
  • view (mandatory) is the name of the view for which the layouts will be retrieved (e.g. 'article').
  • useglobal (optional).
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.

Example XML parameter definition:

<field name="mylayout" type="componentlayout" extension="com_content" view="article" label="JFIELD_ALT_LAYOUT" useglobal="true" description="JFIELD_ALT_COMPONENT_LAYOUT" />

See also[edit]

ContentLanguage form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual ContentLanguage Field instead


Provides a list of content languages.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be contentlanguage.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) tooltip for the form field.

Example XML Definition from plugins/system/languagecode/languagecode.php

if ($languages = JLanguage::getKnownLanguages(JPATH_SITE))
{
	// Inject fields into the form
	foreach ($languages as $tag => $language)
	{
		$form->load('
			<form>
				<fields name="params">
					<fieldset
						name="languagecode"
						label="PLG_SYSTEM_LANGUAGECODE_FIELDSET_LABEL"
						description="PLG_SYSTEM_LANGUAGECODE_FIELDSET_DESC"
					>
						<field
							name="'.strtolower($tag).'"
							type="text"
							description="' . htmlspecialchars(JText::sprintf('PLG_SYSTEM_LANGUAGECODE_FIELD_DESC', $language['name']), ENT_COMPAT, 'UTF-8') . '"
							translate_description="false"
							label="' . $tag . '"
							translate_label="false"
							size="7"
							filter="cmd"
						/>
					</fieldset>
				</fields>
			</form>
		');
	}
}

ContentLanguage form field type/en[edit]

Provides a list of content languages.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be contentlanguage.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) tooltip for the form field.

Example XML Definition from plugins/system/languagecode/languagecode.php

if ($languages = JLanguage::getKnownLanguages(JPATH_SITE))
{
	// Inject fields into the form
	foreach ($languages as $tag => $language)
	{
		$form->load('
			<form>
				<fields name="params">
					<fieldset
						name="languagecode"
						label="PLG_SYSTEM_LANGUAGECODE_FIELDSET_LABEL"
						description="PLG_SYSTEM_LANGUAGECODE_FIELDSET_DESC"
					>
						<field
							name="'.strtolower($tag).'"
							type="text"
							description="' . htmlspecialchars(JText::sprintf('PLG_SYSTEM_LANGUAGECODE_FIELD_DESC', $language['name']), ENT_COMPAT, 'UTF-8') . '"
							translate_description="false"
							label="' . $tag . '"
							translate_label="false"
							size="7"
							filter="cmd"
						/>
					</fieldset>
				</fields>
			</form>
		');
	}
}

Contentlanguage form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Contentlanguage Field instead


Provides a list of installed content languages for use in conjunction with the language switcher plugin.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be contentlanguage.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) tooltip for the form field.

Example XML Definition:

<field name="language" type="contentlanguage"
	label="JFIELD_LANGUAGE_LABEL"
	description="COM_CATEGORIES_FIELD_LANGUAGE_DESC"
	class="span12 small" >
	<option value="*">JALL</option>
</field>

Contentlanguage form field type/en[edit]

Provides a list of installed content languages for use in conjunction with the language switcher plugin.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be contentlanguage.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) tooltip for the form field.

Example XML Definition:

<field name="language" type="contentlanguage"
	label="JFIELD_LANGUAGE_LABEL"
	description="COM_CATEGORIES_FIELD_LANGUAGE_DESC"
	class="span12 small" >
	<option value="*">JALL</option>
</field>

Contenttype form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Contenttype Field instead


Provides a list of content types.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be contenttype.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) tooltip for the form field.

Example XML Definition:

<field name="types" type="contenttype"
	label="COM_TAGS_FIELD_TYPE_LABEL"
	description="COM_TAGS_FIELD_TYPE_DESC"
	multiple="true" />

Contenttype form field type/en[edit]

Provides a list of content types.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be contenttype.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) tooltip for the form field.

Example XML Definition:

<field name="types" type="contenttype"
	label="COM_TAGS_FIELD_TYPE_LABEL"
	description="COM_TAGS_FIELD_TYPE_DESC"
	multiple="true" />

DatabaseConnection form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual DatabaseConnection Field instead


Provides a list of available database connections, optionally limiting to a given list.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be databaseconnection.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) tooltip for the form field.

Example XML Definition:

<field name="dbtype" type="databaseconnection"
	label="COM_CONFIG_FIELD_DATABASE_TYPE_LABEL"
	description="COM_CONFIG_FIELD_DATABASE_TYPE_DESC"
	supported="mysql,mysqli,postgresql,sqlsrv,sqlazure"
	filter="string" />

DatabaseConnection form field type/en[edit]

Provides a list of available database connections, optionally limiting to a given list.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be databaseconnection.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) tooltip for the form field.

Example XML Definition:

<field name="dbtype" type="databaseconnection"
	label="COM_CONFIG_FIELD_DATABASE_TYPE_LABEL"
	description="COM_CONFIG_FIELD_DATABASE_TYPE_DESC"
	supported="mysql,mysqli,postgresql,sqlsrv,sqlazure"
	filter="string" />

Editor form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Editor Field instead


The Editor field type provides a WYSIWYG editor.

  • type (mandatory) must be editor.
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • width (optional) defines the width (in pixels) of the WYSIWYG editor and defaults to 100%. (Currently not supported)
  • height (optional) defines the height (in pixels) of the WYSIWYG editor and defaults to 250px. (Currently not supported)
  • cols (optional) defines the width of the editor (in columns). (Currently not supported)
  • rows (optional) defines the height of the editor (in rows). (Currently not supported)
  • buttons (optional) can be an array of plugin buttons to be excluded or set to false. The default editors-xtd are: article, image, pagebreak and readmore.
  • hide (optional) array of plugin buttons to be hidden. E.g. set buttons="true" hide="readmore,pagebreak"
  • editor specifies the editor to be used and can include two options. (editor="desired|alternative")
  • filter (optional) allow the system to save certain HTML tags or raw data.

Example XML Definition

<field name="test1" type="editor" label="Test Field" description="" width="300" filter="safehtml" />

See Also[edit]

Editor form field type/en[edit]

The Editor field type provides a WYSIWYG editor.

  • type (mandatory) must be editor.
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • width (optional) defines the width (in pixels) of the wysiwyg editor and defaults to 100%. (Currently not supported)
  • height (optional) defines the height (in pixels) of the wysiwyg editor and defaults to 250px. (Currently not supported)
  • cols (optional) defines the width of the editor (in columns). (Currently not supported)
  • rows (optional) defines the height of the editor (in rows). (Currently not supported)
  • buttons (optional) can be an array of plugin buttons to be excluded or set to false. The default editors-xtd are: article, image, pagebreak and readmore.
  • hide (optional) array of plugin buttons to be hidden. eg... set buttons="true" hide="readmore,pagebreak"
  • editor specifies the editor to be used and can include two options (editor="desired|alternative")
  • filter (optional) allow the system to save certain html tags or raw data.

Example XML Definition:

<field name="test1" type="editor" label="Test Field" description="" width="300" filter="safehtml" />

See also[edit]

Editors form field type[edit]

Stop hand nuvola.svg.png
Warning!

The Editors form field type is no longer available. Please use the Plugins Form Field instead


The editors form field type provides a drop down list of the available and enabled WYSIWYG editors. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

Params.editors.jpg

The first option on the list is always '- Select Editor -' (which is a translatable string) and is given the value 0.

  • type (mandatory) must be editors.
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) is the default editor name. This is the name listed in the File column in the Plugin Manager screen.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.

Example XML parameter definition:

<field name="myeditor" type="editors" default="none" label="Select an editor" />

See also[edit]

Editors form field type/en[edit]

The editors form field type provides a drop down list of the available and enabled WYSIWYG editors. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

Params.editors.jpg

The first option on the list is always '- Select Editor -' (which is a translatable string) and is given the value 0.

  • type (mandatory) must be editors.
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) is the default editor name. This is the name listed in the File column in the Plugin Manager screen.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.

Example XML parameter definition:

<field name="myeditor" type="editors" default="none" label="Select an editor" />

See also[edit]

Email form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Email Field instead


Provides an input field for an email address.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be email.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field.
  • size (optional) determines the size of the field on the screen.
  • required (optional) "true" to enforce a value.
  • class (optional) for styling.
  • validate (optional) makes sure it is an emailaddress.

Example XML Definition:

<field name="email" type="email"
	label="JGLOBAL_EMAIL"
	description="COM_ADMIN_USER_FIELD_EMAIL_DESC"
	required="true"
	size="30"
	class="inputbox"
	validate="email" />

Email form field type/en[edit]

Provides an input field for an email address.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be email.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field.
  • size (optional) determines the size of the field on the screen.
  • required (optional) "true" to enforce a value.
  • class (optional) for styling.
  • validate (optional) makes sure it is an emailaddress.

Example XML Definition:

<field name="email" type="email"
	label="JGLOBAL_EMAIL"
	description="COM_ADMIN_USER_FIELD_EMAIL_DESC"
	required="true"
	size="30"
	class="inputbox"
	validate="email" />

File form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual File Field instead


Provides an input field for files

  • type (mandatory) must be file.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (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) (not translatable) is the default value, but doesn't mean much for a file.
  • size (optional) is the width of the file box in characters.
  • accept (optional) Tells the browser what MIME types your form will allow to be uploaded.
  • class (optional) is a CSS class name for the HTML form field.
  • labelclass (optional) adds a CSS class for form field's label; for Joomla 2.5.4+
  • disabled (optional) HTML equivalent attribute
  • onchange (optional) HTML equivalent attribute (javascript use)
  • required Cannot be used with this field type. If the field is marked as required it will always fail validation regardless of whether a file has been uploaded or not. The suggested workaround is to add a filerequired attribute which can be tested in your own file handling code.
  • validate (optional) Whether to Joomla validate the field according to rules
  • showon (optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+
  • multiple (optional) Allows you to upload multiple files at once when set to multiple="true"

Note: When using the file input type you should always add the attribute enctype="multipart/form-data" to your form tag. Otherwise, the uploaded files will not be attached correctly. Note 2: You can put a soft limit file size by adding a hidden field with name="MAX_FILE_SIZE" and value the maximum allowed bytes which is handled by php, but you must also handle it in your code with or without it.

Example XML field definition:

<field name="myfilevalue" type="file" label="Enter some text" description="Choose an image from your computer with maximum 100KB" size="10" accept="image/*" />

See also[edit]

File form field type/de[edit]

Bietet ein Eingabefeld für Dateien.

  • type (notwendig) muss Datei sein.
  • name (notwenig) ist der eindeutige Name des Feldes.
  • label (notwendig) (übersetzbar) ist der beschreibende Titel des Feldes.
  • Beschreibung (optional) (übersetzbar) ist der Text, der als Tooltip als Mouse-over Effekt über die Dropdown-Box angezeigt wird.

default(optional) (nicht übersetzbar) ist der Standardwert, aber von minimaler Bedeutung für eine Datei. size (optional) ist die Breite der Box.

accept (optional) sagt dem Brwser, welche Mime-Typen das Formular hochladen kann.

class (optional) ist der CSS Klassenname für das HTML Formularfeld. labelclass (optional) fügt eine CSS Klasse für das Formularfeld Label hinzu, ab Joomla 2.5.4

  • disabled (optional) HTML equivalent attribute
  • onchange (optional) HTML equivalent attribute (javascript use)
  • required Cannot be used with this field type. If the field is marked as required it will always fail validation regardless of whether a file has been uploaded or not. The suggested workaround is to add a filerequired attribute which can be tested in your own file handling code.
  • validate (optional) Whether to Joomla validate the field according to rules

showon (optional) Erlaubt, ein Feld, das auf den Werten eines anderen Feldes basiert auszublenden, seit Joomla 3.2.4

  • multiple (optional) macht es möglich, mehrere Dateien auf einmal hochzuladen, wenn die Einstellung auf multiple="true" steht.

Note: When using the file input type you should always add the attribute enctype="multipart/form-data" to your form tag. Otherwise, the uploaded files will not be attached correctly. Note 2: You can put a soft limit file size by adding a hidden field with name="MAX_FILE_SIZE" and value the maximum allowed bytes which is handled by php, but you must also handle it in your code with or without it.

Beispiel XML-Felddefinitionen:

<field name="myfilevalue" type="file" label="Enter some text" description="Choose an image from your computer with maximum 100KB" size="10" accept="image/*" />

Siehe auch[edit]

File form field type/en[edit]

Provides an input field for files

  • type (mandatory) must be file.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (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) (not translatable) is the default value, but doesn't mean much for a file.
  • size (optional) is the width of the file box in characters.
  • accept (optional) Tells the browser what MIME types your form will allow to be uploaded.
  • class (optional) is a CSS class name for the HTML form field.
  • labelclass (optional) adds a CSS class for form field's label; for Joomla 2.5.4+
  • disabled (optional) HTML equivalent attribute
  • onchange (optional) HTML equivalent attribute (javascript use)
  • required Cannot be used with this field type. If the field is marked as required it will always fail validation regardless of whether a file has been uploaded or not. The suggested workaround is to add a filerequired attribute which can be tested in your own file handling code.
  • validate (optional) Whether to Joomla validate the field according to rules
  • showon (optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+
  • multiple (optional) Allows you to upload multiple files at once when set to multiple="true"

Note: When using the file input type you should always add the attribute enctype="multipart/form-data" to your form tag. Otherwise, the uploaded files will not be attached correctly. Note 2: You can put a soft limit file size by adding a hidden field with name="MAX_FILE_SIZE" and value the maximum allowed bytes which is handled by php, but you must also handle it in your code with or without it.

Example XML field definition:

<field name="myfilevalue" type="file" label="Enter some text" description="Choose an image from your computer with maximum 100KB" size="10" accept="image/*" />

See also[edit]

Filelist form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Filelist Field instead


The filelist form field type provides a drop down list of files from a specified directory. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

Params.filelist.jpg

By default, the first item on the list is '- Do not use -' (which is translatable) and is given the value '-1' and this is followed by '- Use default -' (also translatable) given the value '0'.

  • type (mandatory) must be filelist.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • directory (optional) is the filesystem path to the directory containing the files to be listed. If omitted the directory given by JPATH_ROOT is assumed.
  • default (optional) is the default file name.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • filter (Joomla 3.x) or fileFilter (Joomla 4.0 and later) (optional) is a regular expression string which is used to filter the list of files selected for inclusion in the drop-down list. If omitted, all files in the directory are included. The filter argument expression is applied before the exclude argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.
  • exclude (optional) is a regular expression string which is used to exclude files from the list. The exclude argument expression is applied after the filter argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.
  • stripext (optional) is a Boolean argument. If true then file name extensions will be stripped from the file names listed. Also note that the file name will be saved without the extension too.
  • hide_none (optional) is a Boolean argument. If true, the '- None selected -' item is omitted from the drop-down list.
  • hide_default (optional) is a Boolean argument. If true, the '- Use default -' item is omitted from the drop-down list.

Example XML field definition:

<field name="myfile" type="filelist" default="" label="Select a file" description="" directory="administrator" filter="" exclude="" stripext="" />

See also[edit]

Filelist form field type/de[edit]

Dieses Feld bietet eine Dropdown Liste von Dateien eines spezifischen Verzeichnisses. Wenn das Feld einen gespeicherten Wert hat, wird dieser Wert beim ersten Laden der Seite angezeigt. Wenn nicht, wird der Standardwerd (falls definiert) gewählt.

Params.filelist.jpg

Standardmäßig, der erste Listenpunkt ist "nicht benutzen" (übersetzbar) und hat den zugewiesenen Wert "-1". Dieses wird gefolgt von "Standard nutzen" (übersetzbar) dem der Wert "0" zugeordnet ist.

type (notwendig) muss "Dateiliste" sein.

  • name (obligatorisch) ist der eindeutige Name des Feldes.
  • label (obligatorisch) (übersetzbar) ist der beschreibende Titel des Feldes.

directory (optional) ist der Dateisystempfad zu dem Verzeichnis, das die gelisteten Dateien enthält. Wenn weggelassen wird das Verzeichnis von JPATH_ROOT vorgeschlagen.

  • default (optional) ist der Standard-Dateiname
  • Beschreibung (optional) (übersetzbar) ist der Text, der als Tooltip als Mouse-over Effekt über die Dropdown-Box angezeigt wird.
  • filter (Joomla 3.x) or fileFilter (Joomla 4.0 and later) (optional) is a regular expression string which is used to filter the list of files selected for inclusion in the drop-down list. If omitted, all files in the directory are included. The filter argument expression is applied before the exclude argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.
  • exclude (optional) is a regular expression string which is used to exclude files from the list. The exclude argument expression is applied after the filter argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.
  • stripext (optional) is a Boolean argument. If true then file name extensions will be stripped from the file names listed. Also note that the file name will be saved without the extension too.

hide_none (optional) ist ein Boolsches Argument. Wenn "true", wird der nicht ausgewählte Artikel von der Drop-down-Liste gestrichen.

  • hide_default (optional) is a Boolean argument. If true, the '- Use default -' item is omitted from the drop-down list.

Beispiel XML-Felddefinitionen:

<field name="myfile" type="filelist" default="" label="Select a file" description="" directory="administrator" filter="" exclude="" stripext="" />

Siehe auch[edit]

Filelist form field type/en[edit]

The filelist form field type provides a drop down list of files from a specified directory. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

Params.filelist.jpg

By default, the first item on the list is '- Do not use -' (which is translatable) and is given the value '-1' and this is followed by '- Use default -' (also translatable) given the value '0'.

  • type (mandatory) must be filelist.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • directory (optional) is the filesystem path to the directory containing the files to be listed. If omitted the directory given by JPATH_ROOT is assumed.
  • default (optional) is the default file name.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • filter (Joomla 3.x) or fileFilter (Joomla 4.0 and later) (optional) is a regular expression string which is used to filter the list of files selected for inclusion in the drop-down list. If omitted, all files in the directory are included. The filter argument expression is applied before the exclude argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.
  • exclude (optional) is a regular expression string which is used to exclude files from the list. The exclude argument expression is applied after the filter argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.
  • stripext (optional) is a Boolean argument. If true then file name extensions will be stripped from the file names listed. Also note that the file name will be saved without the extension too.
  • hide_none (optional) is a Boolean argument. If true, the '- None selected -' item is omitted from the drop-down list.
  • hide_default (optional) is a Boolean argument. If true, the '- Use default -' item is omitted from the drop-down list.

Example XML field definition:

<field name="myfile" type="filelist" default="" label="Select a file" description="" directory="administrator" filter="" exclude="" stripext="" />

See also[edit]

Folderlist form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Folderlist Field instead


The folderlist form field type provides a drop down list of folders from a specfied directory. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

Params.folderlist.jpg

By default, the first item on the list is '- Do not use -' (which is translatable) and is given the value '-1' and this is followed by '- Use default -' (also translatable) given the value '0'.

  • type (mandatory) must be folderlist.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • directory (mandatory) is the filesystem path to the directory containing the folders to be listed.
  • default (optional) is the default folder name.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • filter (Joomla 3.x) or folderFilter (Joomla 4.0 and later) (optional) is a regular expression string which is used to filter the list of folders selected for inclusion in the drop-down list. If omitted, all folders in the directory are included. The filter argument expression is applied before the exclude argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.
  • exclude (optional) is a regular expression string which is used to exclude folders from the list. The exclude argument expression is applied after the filter argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.
  • hide_none (optional) is a Boolean argument. If true, the '- None selected -' item is omitted from the drop-down list.
  • hide_default (optional) is a Boolean argument. If true, the '- Use default -' item is omitted from the drop-down list.
  • recursive (optional) is a Boolean argument. If true, the list of folders recursively includes any sub-folders found. Caution: If you have a large number of sub-folders this can make page loading slow.

Example XML field definition:

<field name="myfolder" type="folderlist" default="" label="Select a folder" directory="administrator" filter="" exclude="" stripext="" />

See also[edit]

Folderlist form field type/en[edit]

The folderlist form field type provides a drop down list of folders from a specfied directory. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

Params.folderlist.jpg

By default, the first item on the list is '- Do not use -' (which is translatable) and is given the value '-1' and this is followed by '- Use default -' (also translatable) given the value '0'.

  • type (mandatory) must be folderlist.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • directory (mandatory) is the filesystem path to the directory containing the folders to be listed.
  • default (optional) is the default folder name.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • filter (Joomla 3.x) or folderFilter (Joomla 4.0 and later) (optional) is a regular expression string which is used to filter the list of folders selected for inclusion in the drop-down list. If omitted, all folders in the directory are included. The filter argument expression is applied before the exclude argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.
  • exclude (optional) is a regular expression string which is used to exclude folders from the list. The exclude argument expression is applied after the filter argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.
  • hide_none (optional) is a Boolean argument. If true, the '- None selected -' item is omitted from the drop-down list.
  • hide_default (optional) is a Boolean argument. If true, the '- Use default -' item is omitted from the drop-down list.
  • recursive (optional) is a Boolean argument. If true, the list of folders recursively includes any sub-folders found. Caution: If you have a large number of sub-folders this can make page loading slow.

Example XML field definition:

<field name="myfolder" type="folderlist" default="" label="Select a folder" directory="administrator" filter="" exclude="" stripext="" />

See also[edit]

Groupedlist form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Groupedlist Field instead


The groupedlist form field type provides a drop down list or a list box of custom-defined entries which has the ability to show grouped data. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

  • type (mandatory) must be groupedlist.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) is the default list item value.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'inputbox'.
  • multiple (optional) is whether multiple items can be selected at the same time (true or false).

The XML <field> element must include one or more <option> elements which define the list items. The text between the <option> and </option> tags is what will be shown in the drop down list and is a translatable string. The <option> tag takes the following argument:

  • value (mandatory) is the value that will be saved for the field if this item is selected.

Tip: Don't forget to close the field definition with </field>.

To group the data simply put a <group> before the <option> elements you want to group and a </group> after them. The <group> tag takes the following argument:

  • label (translatable) is the text shown in the list.

Example XML field definition:

<field name="mylistvalue" type="groupedlist" default="" label="Select an option" description="">
  <group label="Group 1">
    <option value="0">Option 1</option>
    <option value="1">Option 2</option>
  </group>
  <group label="Group 2">
    <option value="3">Option 3</option>
    <option value="4">Option 4</option>
  </group>
  <option value="5">Option 5</option>
  <option value="6">Option 6</option>
</field>

See also[edit]

Groupedlist form field type/en[edit]

The groupedlist form field type provides a drop down list or a list box of custom-defined entries which has the ability to show grouped data. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

  • type (mandatory) must be groupedlist.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) is the default list item value.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'inputbox'.
  • multiple (optional) is whether multiple items can be selected at the same time (true or false).

The XML <field> element must include one or more <option> elements which define the list items. The text between the <option> and </option> tags is what will be shown in the drop down list and is a translatable string. The <option> tag takes the following argument:

  • value (mandatory) is the value that will be saved for the field if this item is selected.

Tip: Don't forget to close the field definition with </field>.

To group the data simply put a <group> before the <option> elements you want to group and a </group> after them. The <group> tag takes the following argument:

  • label (translatable) is the text shown in the list.

Example XML field definition:

<field name="mylistvalue" type="groupedlist" default="" label="Select an option" description="">
  <group label="Group 1">
    <option value="0">Option 1</option>
    <option value="1">Option 2</option>
  </group>
  <group label="Group 2">
    <option value="3">Option 3</option>
    <option value="4">Option 4</option>
  </group>
  <option value="5">Option 5</option>
  <option value="6">Option 6</option>
</field>

See also[edit]

HeaderTag form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Headertag Field instead


Provides a dropdown list of h1 to h6 as options.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be headertag.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) description text for the form field.
  • default (optional) provides a default value.

Example XML Definition:

<field name="header_tag" type="headertag"
	label="COM_MODULES_FIELD_HEADER_TAG_LABEL"
	description="COM_MODULES_FIELD_HEADER_TAG_DESC" 
	default="h3"/>

HeaderTag form field type/en[edit]

Provides a dropdown list of h1 to h6 as options.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be headertag.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) description text for the form field.
  • default (optional) provides a default value.

Example XML Definition:

<field name="header_tag" type="headertag"
	label="COM_MODULES_FIELD_HEADER_TAG_LABEL"
	description="COM_MODULES_FIELD_HEADER_TAG_DESC" 
	default="h3"/>

Helpsite form field type[edit]

Stop hand nuvola.svg.png
Warning!

Since Joomla 4 the Helpsite Form Field type is no longer available


The helpsite form field type provides a drop down list of the help sites in your Joomla installation. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected. With the exception of the “Local” entry, which is always added, the list of help sites is generated from the file:

Params.helpsites.jpg

The 'local' string is translatable. The 'local' URL returned is an empty string.

  • type (mandatory) must be helpsite.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) is the default help site URL (not the visible help site name).
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.

Example XML parameter definition:

<field name="myhelpsite" type="helpsite" default="" label="Select a help site" description="" />

See also[edit]

Helpsite form field type/en[edit]

The helpsite form field type provides a drop down list of the help sites in your Joomla installation. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected. With the exception of the “Local” entry, which is always added, the list of help sites is generated from the file:

Params.helpsites.jpg

The 'local' string is translatable. The 'local' URL returned is an empty string.

  • type (mandatory) must be helpsite.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) is the default help site URL (not the visible help site name).
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.

Example XML parameter definition:

<field name="myhelpsite" type="helpsite" default="" label="Select a help site" description="" />

See also[edit]

Hidden form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Hidden Field instead


The hidden form field type provides a hidden field for saving a field whose value cannot be altered directly by a user in the Administrator (it can be altered in code or by editing the xml file). If the parameter has a saved value this is entered in the text box. If not, the default value (if any) is entered. As the field is hidden there is no visible field in the Administrator.

  • type (mandatory) must be hidden.
  • name (mandatory) is the unique name of the field.
  • default (mandatory) is the data which needs to be collected.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'text_area'.

Example XML field definition:

<field name="mysecretvariable" type="hidden" default="" />

See also[edit]

Hidden form field type/en[edit]

The hidden form field type provides a hidden field for saving a field whose value cannot be altered directly by a user in the Administrator (it can be altered in code or by editing the xml file). If the parameter has a saved value this is entered in the text box. If not, the default value (if any) is entered. As the field is hidden there is no visible field in the Administrator.

  • type (mandatory) must be hidden.
  • name (mandatory) is the unique name of the field.
  • default (mandatory) is the data which needs to be collected.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'text_area'.

Example XML field definition:

<field name="mysecretvariable" type="hidden" default="" />

See also[edit]

Imagelist form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Imagelist Field instead


The imagelist form field type provides a drop down list of image files in a specified directory. Only files with .png, .gif, .jpg, .bmp, .ico extensions are listed. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

Params.imagelist.jpg

By default, the first item on the list is '- Do not use -' (which is translatable) and is given the value '-1' and this is followed by '- Use default -' (also translatable) given the value '0'.

  • type (mandatory) must be imagelist.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • directory (optional) is the filesystem path to the directory containing the image files to be listed. If omitted the directory given by JPATH_ROOT is assumed.
  • default (optional) is the default image file name.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • filter (optional) is a regular expression string which is used to filter the list of image files selected for inclusion in the drop-down list. If omitted, all image files in the directory are included. The filter argument expression is applied before the exclude argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.
  • exclude (optional) is a regular expression string which is used to exclude image files from the list. The exclude argument expression is applied after the filter argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.
  • stripext (optional) is a Boolean argument. If true then file name extensions will be stripped from the image file names listed. Also note that the file name will be saved without the extension too.
  • hide_none (optional) is a Boolean argument. If true, the '- Do not use -' item is omitted from the drop-down list.
  • hide_default (optional) is a Boolean argument. If true, the '- Use default -' item is omitted from the drop-down list.

Example XML field definition:

<field name="myimage" type="imagelist" default="" label="Select an image" description="" directory="" exclude="" stripext="" />

See also[edit]

Imagelist form field type/en[edit]

The imagelist form field type provides a drop down list of image files in a specified directory. Only files with .png, .gif, .jpg, .bmp, .ico extensions are listed. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

Params.imagelist.jpg

By default, the first item on the list is '- Do not use -' (which is translatable) and is given the value '-1' and this is followed by '- Use default -' (also translatable) given the value '0'.

  • type (mandatory) must be imagelist.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • directory (optional) is the filesystem path to the directory containing the image files to be listed. If omitted the directory given by JPATH_ROOT is assumed.
  • default (optional) is the default image file name.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • filter (optional) is a regular expression string which is used to filter the list of image files selected for inclusion in the drop-down list. If omitted, all image files in the directory are included. The filter argument expression is applied before the exclude argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.
  • exclude (optional) is a regular expression string which is used to exclude image files from the list. The exclude argument expression is applied after the filter argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.
  • stripext (optional) is a Boolean argument. If true then file name extensions will be stripped from the image file names listed. Also note that the file name will be saved without the extension too.
  • hide_none (optional) is a Boolean argument. If true, the '- Do not use -' item is omitted from the drop-down list.
  • hide_default (optional) is a Boolean argument. If true, the '- Use default -' item is omitted from the drop-down list.

Example XML field definition:

<field name="myimage" type="imagelist" default="" label="Select an image" description="" directory="" exclude="" stripext="" />

See also[edit]

Integer form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Integer Field instead


The integer form field type provides a select box with a range of integer values. 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 selected.

  • type (mandatory) must be integer.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) (translatable) is the default value.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'text_area'.
  • first (mandatory) this value is the lowest on the list.
  • last (mandatory) this value is the highest on the list.
  • step (mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.

Example XML field definition which would create a select box with the choices of 1,2,3,4,5,6,7,8,9,10:

<field name="myintegervalue" type="integer" default="Some integer" label="Choose an integer" description="" first="1" last="10" step="1" />

See also[edit]

Integer form field type/en[edit]

The integer form field type provides a select box with a range of integer values. 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 selected.

  • type (mandatory) must be integer.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) (translatable) is the default value.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'text_area'.
  • first (mandatory) this value is the lowest on the list.
  • last (mandatory) this value is the highest on the list.
  • step (mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.

Example XML field definition which would create a select box with the choices of 1,2,3,4,5,6,7,8,9,10:

<field name="myintegervalue" type="integer" default="Some integer" label="Choose an integer" description="" first="1" last="10" step="1" />

See also[edit]

Language form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Language Field instead


The languages form field type provides a drop down list of the installed languages for the Frontend or Backend. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected. The value saved is the language tag. For example, for English (United Kingdom) this will be en-GB.

Params.language.jpg

The first option on the list is always - Select Language - (which is a translatable string) and is given the value 0.

  • type (mandatory) must be language.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • client (mandatory) is the application whose installed languages will be listed. Use site when you want to list the Frontend languages or administrator when you want to list the Backend languages.
  • default (optional) is the default language tag. For example, en-GB.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.

Example XML parameter definition:

 lang="xml"><field name="mylanguage" type="language" client="site" default="en-GB" label="Select a language" description="" />

See Also[edit]

Language form field type/en[edit]

The languages form field type provides a drop down list of the installed languages for the Front-end or Back-end. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected. The value saved is the language tag. For example, for English (United Kingdom) this will be 'en-GB'.

Params.language.jpg

The first option on the list is always '- Select Language -' (which is a translatable string) and is given the value 0.

  • type (mandatory) must be language.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • client (mandatory) is the application whose installed languages will be listed. Use site when you want to list the Front-end languages or administrator when you want to list the Back-end languages.
  • default (optional) is the default language tag. For example, 'en-GB'.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.

Example XML parameter definition:

<field name="mylanguage" type="language" client="site" default="en-GB" label="Select a language" description="" />

See also[edit]

List form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual List Field instead


The list form field type provides a drop down list or a list box of custom-defined entries. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

Params.list.jpg
  • type (mandatory) must be list.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) is the default list item value.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'inputbox'.
  • multiple (optional) is whether multiple items can be selected at the same time (true or false).
  • required (optional) if set to true, the first field option should be empty, see last example.
  • useglobal (optional) if set to true, it will show the value that is set in the global configuration if found in the database.

The XML <field> element must include one or more <option> elements which define the list items. The text between the <option> and </option> tags is what will be shown in the drop down list and is a translatable string. The <option> tag takes the following argument:

  • value (mandatory) is the value that will be saved for the field if this item is selected.
  • requires (optional) Values: multilanguage, associations and adminlanguage can be used.

Tip: Don't forget to close the field definition with </field>.
Tip: Add first an option without a value, with a text like "Select an option". Otherwise, in case of a required field, the first option with a value gets silently selected (i.e., without the user choosing it). This text will typically be seen by users before clicking the dropdown list.
Tip: Some values for "name" field are reserved, so don't use them and avoid problems. One of them is: "style".

Example XML field definition:

<field name="mylistvalue" type="list" default="" label="Select an option" description="">
  <option value="0">Option 1</option>
  <option value="1">Option 2</option>
</field>

Example XML field definition with required field value:

<field name="mylistvalue" type="list" default="" required="true" label="Select an option" description="">
  <option value="">Please Select</option>
  <option value="0">Option 1</option>
  <option value="1">Option 2</option>
</field>

Showon attribute for list options[edit]

Since Joomla 3.9.0 one can use the showon attribute for option tags in a list field.

Example XML for two list fields fielda and fieldb where the displayed options of fieldb are controlled by selections in fielda

<field
    name="fielda"
    type="list"
    label="FIELDA_LABEL"
    description="FIELDA_DESC"
    >
    <option value="editor">TYPE_EDITOR</option>
    <option value="text">TYPE_TEXT</option>
    <option value="textarea">TYPE_TEXTAREA</option>
</field>

<field
    name="fieldb"
    type="list"
    label="FIELDB_LABEL"
    description="FIELDB_DESC"
    >
    <option value="0">JNO</option>
    <option value="1">Option 1</option>
    <option
	    showon="fielda:text,textarea"
	    value="2">Option 2</option>
    <option
	    showon="fielda:text"
	    value="3">Option 3</option>
</field>
  • "Option 3" of fieldb is only displayed if option "TYPE_TEXT" is selected in fielda.
  • "Option 2" of fieldb is only displayed if option "TYPE_TEXT" OR "TYPE_TEXTAREA" is selected in fielda.
  • "Option 1" and "JNO" of fieldb is always displayed.

See also[edit]

Media form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Media Field instead


The media form field type provides modal access to the media manager for the choice of an image or other kind of media, e.g. video. Users with appropriate permissions will be able to upload files.

  • type (mandatory) must be media.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (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.
  • directory (optional) is the directory from which the user will be able to choose a file. This attribute should be relative to the top level /images/ folder. The default is that the user will be confined to the top level /images/ folder.
  • preview (optional) shows or hides the preview of the currently chosen image. ("true": Show always, "tooltip": Show as tooltip, "false": Show never). Default is "tooltip". (since Joomla! 2.5.5)
  • preview_width (optional) sets the max-width of preview image (default: "200").
  • preview_height (optional) sets the max-height of preview image (default: "200").
  • types (optional) is a comma-separated list of file types ("images", "audios", "videos" and "documents"). Default is "images". This list decides which of the allowed file extensions from Media Manager configuration are used. E.g. "images,documents" means only files with an allowed images extension or an allowed documents extension are available for selection. (since Joomla! 4.0.0)

Example XML field definition:

<field name="myimage" type="media" directory="stories" />

This will open the media manager with the directory /images/stories/ already selected.

Note that if you are using this field on the frontend then permissions restrictions are likely to be in force. If the user is not authorised to view or add media they will see an error page in the modal popup ("403 You are not authorised to view this resource.").

See also[edit]

Menu form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Menu Field instead


The menu form field type provides a drop down list of the available menus from your Joomla! site. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

Params.menu.jpg

The first option on the list is always '- Select Menu -' (which is a translatable string) and is given the value 0.

  • type (mandatory) must be menu.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) is the default menu. Note that this is the name of the menu shown in the Type column on the Menu Manager screen and not the menu ID number.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.

Example XML field definition:

<field name="mymenu" type="menu" default="mainmenu" label="Select a menu" description="Select a menu" />

See also[edit]

Menu form field type/en[edit]

The menu form field type provides a drop down list of the available menus from your Joomla! site. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

Params.menu.jpg

The first option on the list is always '- Select Menu -' (which is a translatable string) and is given the value 0.

  • type (mandatory) must be menu.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) is the default menu. Note that this is the name of the menu shown in the Type column on the Menu Manager screen and not the menu ID number.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.

Example XML field definition:

<field name="mymenu" type="menu" default="mainmenu" label="Select a menu" description="Select a menu" />

See also[edit]

Menuitem form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Menuitem Field instead


The menuitem form field type provides a drop down grouped list of the available menu items from your Joomla site.

Params.menuitem.jpg
  • type (mandatory) must be menuitem.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) is the default menu item. Note that this is the ItemID number of the menu item.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • published (optional) determines whether all menu items are listed or only published menu items. If state is '0' then all menu items will be listed. If state is '1' then only published menu items will be listed. You also can use comma separated values like '1,2'.
  • menu_type (optional) filters by the menutype value in database table #__menu or rather the value of form field Menu Type in edit form of a menu.
  • client_id (optional) filters by the client_id value in database table #__menu. '0' for site menu items. '1' for administrator menu items. The default value is '0'.
  • language (optional) filters by the language value in database table #__menu (language tags). You can also use comma separated values like 'en-GB,de-DE'.

To add additional rows with translatable strings (such as "Select" or "Default") add an option to the XML. For example:

<option	value="">JDEFAULT</option>

Example XML field definition:

<field name="mymenuitem" type="menuitem" default="45" label="Select a menu item" description="Select a menu item" />

Resolving a URL[edit]

The menuitem form field type gives the ID of the selected menu item. To get a search engine friendly URL using the ID, use JRoute:

JRoute::_("index.php?Itemid={$id}");

See also[edit]

Menuitem form field type/en[edit]

The menuitem form field type provides a drop down grouped list of the available menu items from your Joomla site.

Params.menuitem.jpg
  • type (mandatory) must be menuitem.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) is the default menu item. Note that this is the ItemID number of the menu item.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • published (optional) determines whether all menu items are listed or only published menu items. If state is '0' then all menu items will be listed. If state is '1' then only published menu items will be listed. You also can use comma separated values like '1,2'.
  • menu_type (optional) filters by the menutype value in database table #__menu or rather the value of form field Menu Type in edit form of a menu.
  • client_id (optional) filters by the client_id value in database table #__menu. '0' for site menu items. '1' for administrator menu items. The default value is '0'.
  • language (optional) filters by the language value in database table #__menu (language tags). You can also use comma separated values like 'en-GB,de-DE'.

To add additional rows with translatable strings (such as "Select" or "Default") add an option to the XML. For example:

<option	value="">JDEFAULT</option>

Example XML field definition:

<field name="mymenuitem" type="menuitem" default="45" label="Select a menu item" description="Select a menu item" />

Resolving a URL[edit]

The menuitem form field type gives the ID of the selected menu item. To get a search engine friendly URL using the ID, use JRoute:

JRoute::_("index.php?Itemid={$id}");

See also[edit]

Meter form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Meter Field instead


Draws a progress bar. (see here for more details)

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be meter.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) tooltip for the form field.
  • class (optional) specify your own classes for additonal markup
  • size (optional) sets the input size of the field
  • default (optional) the initial value of the progress bar.
  • min (optional) the minimum value of the progress bar.
  • max (optional) the maximum value of the progress bar.
  • step (optional) the step at which the progress changes on the bar.
  • animated (optional)(default:true) sets whether the progress bar is animated or not.
  • active (optional)(default:false) sets whether the progress bar animation is active. Works with animated .

Note that without setting the min and max values it will probably not work as expected. This is NOT an input type. It just creates a progress bar:

        <field name="meter"
               active="true"
               type="meter"
               label="Meter"
               max="1000"
               min="1"
               step="10"
               default="240"
               />

This will create the following HTML code:

<div class="control-group">
  <div class="control-label">
    <label id="jform_meter-lbl" for="jform_meter" class="">
	Meter
    </label>
    </div>
    <div class="controls">
       <div class="progress  progress-striped active" data-max="1000" data-min="1" data-step="10" data-value="240">		
          <div class="bar" style="width: 23.923923923924%;"></div>
       </div>
    </div>
</div>

Meter form field type/en[edit]

Draws a progress bar. (see here for more details)

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be meter.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) tooltip for the form field.
  • class (optional) specify your own classes for additonal markup
  • size (optional) sets the input size of the field
  • default (optional) the initial value of the progress bar.
  • min (optional) the minimum value of the progress bar.
  • max (optional) the maximum value of the progress bar.
  • step (optional) the step at which the progress changes on the bar.
  • animated (optional)(default:true) sets whether the progress bar is animated or not.
  • active (optional)(default:false) sets whether the progress bar animation is active. Works with animated .

Note that without setting the min and max values it will probably not work as expected. This is NOT an input type. It just creates a progress bar:

        <field name="meter"
               active="true"
               type="meter"
               label="Meter"
               max="1000"
               min="1"
               step="10"
               default="240"
               />

This will create the following HTML code:

<div class="control-group">
  <div class="control-label">
    <label id="jform_meter-lbl" for="jform_meter" class="">
	Meter
    </label>
    </div>
    <div class="controls">
       <div class="progress  progress-striped active" data-max="1000" data-min="1" data-step="10" data-value="240">		
          <div class="bar" style="width: 23.923923923924%;"></div>
       </div>
    </div>
</div>

ModuleOrder form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual ModuleOrder Field instead


Provides a drop down to set the ordering of module in a given position.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be moduleorder.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) tooltip for the form field.

Example XML Definition:

<field name="ordering" type="moduleorder"
	label="JFIELD_ORDERING_LABEL" 
	description="JFIELD_ORDERING_DESC" />

ModuleOrder form field type/en[edit]

Provides a drop down to set the ordering of module in a given position.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be moduleorder.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) tooltip for the form field.

Example XML Definition:

<field name="ordering" type="moduleorder"
	label="JFIELD_ORDERING_LABEL" 
	description="JFIELD_ORDERING_DESC" />

ModulePosition form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual ModulePosition Field instead


Provides a text input and button to set the position of a module.

  • type (mandatory) must be moduleposition.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (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.

Example XML Definition

<field name="position" type="moduleposition"	
	description="COM_MODULES_FIELD_POSITION_DESC"
	label="COM_MODULES_FIELD_POSITION_LABEL"
	default=""
	maxlength="50" />

If adding this field to a fieldset outside of the com_modules scope you will have to include addfieldpath="administrator/components/com_modules/models/fields" in your <fieldset> tag

<fieldset name="fieldsetname" label="myfield"
	  addfieldpath="administrator/components/com_modules/models/fields"
>

If set up properly, you will see a button displayed next to the textbox (with Joomla standard language text that you can set up to say what you wish in your language file) which when clicked, brings up the standard module position selection window you're used to seeing in the Module Manager.

ModulePosition form field type/en[edit]


Provides a text input and button to set the position of a module.

  • type (mandatory) must be moduleposition.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (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.

Example XML Definition

<field name="position" type="moduleposition"	
	description="COM_MODULES_FIELD_POSITION_DESC"
	label="COM_MODULES_FIELD_POSITION_LABEL"
	default=""
	maxlength="50" />

If adding this field to a fieldset outside of the com_modules scope you will have to include addfieldpath="administrator/components/com_modules/models/fields" in your <fieldset> tag

<fieldset name="fieldsetname" label="myfield"
	  addfieldpath="administrator/components/com_modules/models/fields"
>

If set up properly, you will see a button displayed next to the textbox (with Joomla standard language text that you can set up to say what you wish in your language file) which when clicked, brings up the standard module position selection window you're used to seeing in the Module Manager.

ModuleTag form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual ModuleTag Field instead


Provides a list of html5 elements (used to wrap a module in).

  • type (mandatory) must be moduletag.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (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.

Example XML Definition:

<field name="module_tag" type="moduletag"
	label="COM_MODULES_FIELD_MODULE_TAG_LABEL"
	description="COM_MODULES_FIELD_MODULE_TAG_DESC"
	default="div" />

ModuleTag form field type/en[edit]

Provides a list of html5 elements (used to wrap a module in).

  • type (mandatory) must be moduletag.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (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.

Example XML Definition:

<field name="module_tag" type="moduletag"
	label="COM_MODULES_FIELD_MODULE_TAG_LABEL"
	description="COM_MODULES_FIELD_MODULE_TAG_DESC"
	default="div" />

Modulelayout form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Modulelayout Field instead


The modulelayout form field type provides a drop down list of all available layouts for a module, grouped by core and template. If the parameter has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

  • type (mandatory) must be modulelayout.
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (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.

Combining following attributes enable you to provide a drop down list of layouts of a specific module.

  • module (optional) is a specific module name (e.g. mod_articles_category).
  • client_id (optional).
    • If 0 (site): Forces searching for layouts only in directories /modules/[MODULENAME]/tmpl/ and all /templates/[TEMPLATENAME]/html/[MODULENAME]/.
    • If 1 (administrator): Forces searching for layouts only in directories /administrator/modules/[MODULENAME]/tmpl/ and all /administrator/templates/[TEMPLATENAME]/html/[MODULENAME]/.
  • template (optional) is a template name (e.g. protostar or isis). If set forces searching for module template overrides only in this template.

Example XML parameter definition:

<field name="mymodulelayout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" />


Use Language Constants as Option Values[edit]

The layout values can be translated if a language constant has been defined in the correct format in the module or template.

Within the module language file:

MOD_MYMODULE_LAYOUT_LIST="My Option Label"

The string "My Option Label" is displayed for the file / option "list.php" and not "list".



See also[edit]

Modulelayout form field type/en[edit]

The modulelayout form field type provides a drop down list of all available layouts for a module, grouped by core and template. If the parameter has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

  • type (mandatory) must be modulelayout.
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (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.

Combining following attributes enable you to provide a drop down list of layouts of a specific module.

  • module (optional) is a specific module name (e.g. mod_articles_category).
  • client_id (optional).
    • If 0 (site): Forces searching for layouts only in directories /modules/[MODULENAME]/tmpl/ and all /templates/[TEMPLATENAME]/html/[MODULENAME]/.
    • If 1 (administrator): Forces searching for layouts only in directories /administrator/modules/[MODULENAME]/tmpl/ and all /administrator/templates/[TEMPLATENAME]/html/[MODULENAME]/.
  • template (optional) is a template name (e.g. protostar or isis). If set forces searching for module template overrides only in this template.

Example XML parameter definition:

<field name="mymodulelayout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" />

See also[edit]

Note form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Note Field instead


This form field makes it possible to create titles, texts, descriptions and even alert boxes. It also allows you to bring order in the settings for extensions, by separating them with useful titles. Or adding descriptions for certain settings (without having to rely on the tooltips). Or adding any other text you want.

The syntax is straight-forward:

<field name="..." type="note" label="..." description="..." class="..." close="..." />

Attributes[edit]

  • Name: contains the name of the field (as with any other field tag)
  • Type: the type of the field, which is: note
  • Label: the title of the note (uses JText) (optional if using description)
  • Description: the description/text of the note (uses JText) (optional if using label)
  • Heading: the type of heading element to use for the label (optional) (default: h4)
  • Class: a class name (or class names), like alert (see below for examples) (optional)
  • Close: a value of 'true' (for alerts) or the value for the data-dismiss of the Bootstrap close icon (optional)

Title and Description[edit]

In the following code examples we will use these example language strings:

LOREMIPSUM="Lorem ipsum dolor sit amet"
LOREMIPSUM_DESC="Consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat."

With this note field you can either use the title or the description or both.

<field name="opt10" type="text" label="Some Other Option" />
<field name="note11" type="note" label="LOREMIPSUM" />
<field name="opt11" type="text" label="Some Other Option" />
<field name="note12" type="note" description="LOREMIPSUM_DESC" />
<field name="opt12" type="text" label="Some Other Option" />
<field name="note13" type="note" label="LOREMIPSUM" description="LOREMIPSUM_DESC" />
<field name="opt13" type="text" label="Some Other Option" />

Help25-note-form-field-title-screenshot.png

Classes (Alerts)[edit]

You can add classes to the note. In this way you can easily make (Bootstrap) alerts and also add other styling via class names (like a 'well').

<field name="opt20" type="text" label="Some Other Option" />
<field name="note21" type="note" class="alert" label="LOREMIPSUM" description="LOREMIPSUM_DESC" />
<field name="opt21" type="text" label="Some Other Option" />
<field name="note22" type="note" class="alert alert-info" label="LOREMIPSUM" description="LOREMIPSUM_DESC" />
<field name="opt22" type="text" label="Some Other Option" />
<field name="note23" type="note" class="alert alert-success" label="LOREMIPSUM" description="LOREMIPSUM_DESC" />
<field name="opt23" type="text" label="Some Other Option" />
<field name="note24" type="note" class="alert alert-error" label="LOREMIPSUM" description="LOREMIPSUM_DESC" />
<field name="opt24" type="text" label="Some Other Option" />

Help25-note-form-field-classes-screenshot.png

Close Button[edit]

A close button can be added to the alerts by adding the close="true" attribute to the tag. If you use a class other than the alert, use the required value for the data-dismiss of the Bootstrap close icon instead of the value true. Here is the code to test the close icon on an alert.

<field name="opt30" type="text" label="Some Other Option" />
<field name="note31" type="note" class="alert" close="true" label="LOREMIPSUM" description="LOREMIPSUM_DESC" />
<field name="opt31" type="text" label="Some Other Option" />

Help25-note-form-field-close-screenshot.png

Be aware that a closed alert/note cannot be reopened by the user without page reload. It's not a show/hide functionality.

See Also[edit]

Note form field type/en[edit]

This form field makes it possible to create titles, texts, descriptions and even alert boxes. It also allows you to bring order in the settings for extensions, by separating them with useful titles. Or adding descriptions for certain settings (without having to rely on the tooltips). Or adding any other text you want.

The syntax is pretty straight-forward:

<field name="..." type="note" label="..." description="..." class="..." close="..." />

Attributes[edit]

  • Name: contains the name of the field (like with any other field tag)
  • Type: the type of the field, which is: note
  • Label: the title of the note (uses JText) (optional if using description)
  • Description: the description/text of the note (uses JText) (optional if using label)
  • Heading: the type of heading element to use for the label (optional) (default: h4)
  • Class: a class name (or class names), like alert (see further for examples) (optional)
  • Close: a value of 'true' (for alerts) or the value for the data-dismiss of the bootstrap close icon (optional)

Title and or Description[edit]

In the following code examples we will use these example language strings:

LOREMIPSUM="Lorem ipsum dolor sit amet"
LOREMIPSUM_DESC="Consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat."

So with this note field you can either use the title or the description or both.

<field name="opt10" type="text" label="Some Other Option" />
<field name="note11" type="note" label="LOREMIPSUM" />
<field name="opt11" type="text" label="Some Other Option" />
<field name="note12" type="note" description="LOREMIPSUM_DESC" />
<field name="opt12" type="text" label="Some Other Option" />
<field name="note13" type="note" label="LOREMIPSUM" description="LOREMIPSUM_DESC" />
<field name="opt13" type="text" label="Some Other Option" />

Help25-note-form-field-title-screenshot.png

Classes (Alerts)[edit]

You can add classes to the note. This way you can make (bootstrap) alerts very easily. But also any other styling via class names you want (like a 'well').

<field name="opt20" type="text" label="Some Other Option" />
<field name="note21" type="note" class="alert" label="LOREMIPSUM" description="LOREMIPSUM_DESC" />
<field name="opt21" type="text" label="Some Other Option" />
<field name="note22" type="note" class="alert alert-info" label="LOREMIPSUM" description="LOREMIPSUM_DESC" />
<field name="opt22" type="text" label="Some Other Option" />
<field name="note23" type="note" class="alert alert-success" label="LOREMIPSUM" description="LOREMIPSUM_DESC" />
<field name="opt23" type="text" label="Some Other Option" />
<field name="note24" type="note" class="alert alert-error" label="LOREMIPSUM" description="LOREMIPSUM_DESC" />
<field name="opt24" type="text" label="Some Other Option" />

Help25-note-form-field-classes-screenshot.png

Close button[edit]

A close button can be added to the alerts by adding the close="true" attribute to the tag. If you use a different class than the alert, use the required value for the data-dismiss of the bootstrap close icon instead of the value "true". But here is the code to test the close icon on an alert.

<field name="opt30" type="text" label="Some Other Option" />
<field name="note31" type="note" class="alert" close="true" label="LOREMIPSUM" description="LOREMIPSUM_DESC" />
<field name="opt31" type="text" label="Some Other Option" />

Help25-note-form-field-close-screenshot.png

Be aware that a closed alert/note cannot be reopened by the user without page reload. It's not a show/hide functionality.

See also[edit]

Number form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Number Field instead


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. Available from Joomla 3.2

  • 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.

Example XML field definition which would create a number box with possibility to chose values between 0 and 10 and change current value by 1 each time user click up/down field button.

<field name="mynumbervalue" type="number" default="0" label="Choose an number" description="" min="0" max="10" step="1" />

See also[edit]

Number form field type/en[edit]

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. Available from Joomla 3.2

  • 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.

Example XML field definition which would create a number box with possibility to chose values between 0 and 10 and change current value by 1 each time user click up/down field button.

<field name="mynumbervalue" type="number" default="0" label="Choose an number" description="" min="0" max="10" step="1" />

See also[edit]

Password form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Password Field instead


The password form field type provides a text box for entry of a password. The password characters will be obscured as they are entered. If the field has a saved value this is entered (in obscured form) into the text box. If not, the default value (if any) is entered.

Params.password.jpg

Note that the password string is stored in params.ini in cleartext; the stored value is not obscured by any hash function. Since most web servers will, by default, serve a params.ini file if the URL is entered in a web browser, this cannot be considered a secure method of holding a password.

  • type (mandatory) must be password.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • size (optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.
  • default (optional) is the default password.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'text_area'.
  • lock (optional) is a boolean value, if active it removes the password from the output and adds a Modify button to the password field. It only transmits data if the fields is in modify mode.

Example XML field definition:

<field name="mypassword" type="password" default="secret" label="Enter a password" description="" size="5" />

See also[edit]

Password form field type/en[edit]

The password form field type provides a text box for entry of a password. The password characters will be obscured as they are entered. If the field has a saved value this is entered (in obscured form) into the text box. If not, the default value (if any) is entered.

Params.password.jpg

Note that the password string is stored in params.ini in cleartext; the stored value is not obscured by any hash function. Since most web servers will, by default, serve a params.ini file if the URL is entered in a web browser, this cannot be considered a secure method of holding a password.

  • type (mandatory) must be password.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • size (optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.
  • default (optional) is the default password.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'text_area'.
  • lock (optional) is a boolean value, if active it removes the password from the output and adds a Modify button to the password field. It only transmits data if the fields is in modify mode.

Example XML field definition:

<field name="mypassword" type="password" default="secret" label="Enter a password" description="" size="5" />

See also[edit]

Plugins form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Plugins Field instead


Provides a dropdown list of plugin options from the folder.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be plugins.
  • folder (mandatory) editors or captcha.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field.

Example XML Definition:

<field name="editor" type="plugins" folder="editors"
	description="COM_USERS_USER_FIELD_EDITOR_DESC"
	label="COM_USERS_USER_FIELD_EDITOR_LABEL" >
	<option value="">JOPTION_USE_DEFAULT</option>
</field>
<field name="captcha" type="plugins" folder="captcha"
	label="COM_CONTACT_FIELD_CAPTCHA_LABEL"
	description="COM_CONTACT_FIELD_CAPTCHA_DESC"
	default="" 
	filter="cmd" >
	<option value="">JOPTION_USE_DEFAULT</option>
	<option value="0">JOPTION_DO_NOT_USE</option>
</field>

Plugins form field type/en[edit]

Provides a dropdown list of plugin options from the folder.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be plugins.
  • folder (mandatory) editor or captcha.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field.

Example XML Definition:

<field name="editor" type="plugins" folder="editors"
	description="COM_USERS_USER_FIELD_EDITOR_DESC"
	label="COM_USERS_USER_FIELD_EDITOR_LABEL" >
	<option value="">JOPTION_USE_DEFAULT</option>
</field>
<field name="captcha" type="plugins" folder="captcha"
	label="COM_CONTACT_FIELD_CAPTCHA_LABEL"
	description="COM_CONTACT_FIELD_CAPTCHA_DESC"
	default="" 
	filter="cmd" >
	<option value="">JOPTION_USE_DEFAULT</option>
	<option value="0">JOPTION_DO_NOT_USE</option>
</field>

Predefined List form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual PredefinedList Field instead


The PredefinedList form field type provides a drop down list of pre-defined entries. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

Largely the configuration options are the same as that of the list field however the values for the field are created by the predefinedOptions class variable. So the following variables have the same meaning as the list field:

Params.list.jpg
  • type (mandatory) must be PredefinedList.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) is the default list item value.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'inputbox'.
  • multiple (optional) is whether multiple items can be selected at the same time (true or false).
  • required (optional) if set to true, the first field option should be empty, see last example.
  • useglobal (optional) if set to true, it will show the value that is set in the global configuration if found in the database.

Example XML field definition:

<field name="mylistvalue" type="Myextension.Mycustompredefinedlist" default="" label="Select an option" description="">
</field>

this would be accompanied by your field defined in PHP which would look like:

class MyextensionFormFieldMycustompredefinedlist extends JFormFieldPredefinedList
{
	public $type = 'Mycustompredefinedlist';

	protected $predefinedOptions = array(
		'1'  => 'COM_FOO_LABEL_FOR_TRANSLATION',
		'0'  => 'COM_FOO_ANOTHER_LABEL_FOR_TRANSLATION',
	);
}

Additionally in PHP you can set the `translate` class variable to false which will cause the values of your predefined option to not pass through JText for translation before being shown to the user.

Radio form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Radio Field instead


The radio form field type provides radio buttons to select options. If the field has a saved value, this is selected when the page is first loaded. If not, the default value (if any) is selected.

Params.radio.jpg
  • type (mandatory) must be radio.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) is the default radio button item value.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) New in Joomla 3, if set to class="btn-group btn-group-yesno" will show coloured buttons

The XML <field> element must include one or more <option> elements which define the individual radio button items. The text between the <option> and </option> tags is shown as the label for the radio button and is a translatable string. The <option> tag takes the following argument:

  • value (mandatory) is the value that will be saved for the parameter if this item is selected.

Tip: Don't forget to close the field definition with </field>.

Example XML field definition:

<field name="myradiovalue" type="radio" default="0" label="Select an option" description="">
  <option value="0">1</option>
  <option value="1">2</option>
</field>

For Joomla 3+ styling with arbitrary values:

<field name="myradiovalue" type="radio" default="0" label="Select an option" description="" class="btn-group">
  <option value="0">1</option>
  <option value="1">2</option>
</field>

For Joomla 3+ styling with yes/no values:

<field name="myradiovalue" type="radio" default="0" label="Select an option" description="" class="btn-group btn-group-yesno">
  <option value="1">JYES</option>
  <option value="0">JNO</option>
</field>

See Also[edit]

Radio form field type/en[edit]

The radio form field type provides radio buttons to select different options. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

Params.radio.jpg
  • type (mandatory) must be radio.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) is the default radio button item value.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) New in Joomla 3, if set to class="btn-group btn-group-yesno" will show the nice coloured buttons

The XML <field> element must include one or more <option> elements which define the individual radio button items. The text between the <option> and </option> tags is shown as the label for the radio button and is a translatable string. The <option> tag takes the following argument:

  • value (mandatory) is the value that will be saved for the parameter if this item is selected.

Tip: Don't forget to close the field definition with </field>.

Example XML field definition:

<field name="myradiovalue" type="radio" default="0" label="Select an option" description="">
  <option value="0">1</option>
  <option value="1">2</option>
</field>

For Joomla 3+ styling with arbitrary values:

<field name="myradiovalue" type="radio" default="0" label="Select an option" description="" class="btn-group">
  <option value="0">1</option>
  <option value="1">2</option>
</field>

For Joomla 3+ styling with yes/no values:

<field name="myradiovalue" type="radio" default="0" label="Select an option" description="" class="btn-group btn-group-yesno">
  <option value="1">JYES</option>
  <option value="0">JNO</option>
</field>

See also[edit]

Range form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Range Field instead


The ‘range' form field type provides a horizontal slider for numeric input. While the default value can be set, there is no indication of the actual value being chosen, just the position of the slider’s thumb. Available from Joomla 3.2

  • type (mandatory) must be range.
  • name (mandatory) is the unique name of the field.
  • label (optional) (translatable) is the descriptive title of the field, and will appear in the pop-up when hovering over label as well.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the label.
  • default (optional) (translatable) is the initial 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).
  • required (optional) should the user be required to enter data in this field?

Example XML field definition which would create a slider having the initial value of 0, with possibility to choose values between -0.5 and 0.5. The slider’s value changes by 0.1 as the slider is moved left or right.

<field name="myrange" type="range" default="0" label="Range from -0.5 to 0.5 step 0.1" description="" min="-0.5" max="0.5" step="0.1" />


See also[edit]

Repeatable form field type[edit]

Stop hand nuvola.svg.png
Warning!

Since Joomla 4 this field is no longer available. Please use the Subform Field instead


This field is deprecated

Please use the Subform form field type (in multiple mode) instead.

Provides a modal with rows of formfields that you specify. As many options can be added as desired. Note this form field has a jQuery based javascript file as a dependency.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be repeatable.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field. Displays at the top of the modal with the name as well as in the usual position in the form.
  • default The default value for the form field if the field is left empty. Note this has to be a json string compatible with the contents of the form field.
  • id id of the hidden form field. (the modal will have this id with an added suffix of "_modal" and the table within the modal will have this id with a suffix of "_modal_table").
  • class class of the table.
  • select (translatable) The text to show on the modal button.
  • icon the icon to show on the select button (is prefixed with "icon-").
  • maximum the maximum number of rows of fields allowed (by default 999 to be effectively infinite).

To create a form field you must first of all create a repeatable form field as usual.

<fields>

Within this you place open and close tag (if not already in one - if there is an existing fields tag for params etc. this is not needed.) and within this a tag.

<fieldset>

The fieldset tag MUST have a name the same as your repeatable field name with "_modal" appended to the end of it - it should also have the in the fieldset tag.

repeat="true"

Within this fieldset you then include the form fields that you wish to have repeating (as with any form field).

Example XML Definition

<field name="list_templates"
	type="repeatable"
	icon="list"
	description="PLG_TINY_FIELD_TEMPLATE_FIELD_ELEMENTS_DESC"
	label="PLG_TINY_FIELD_TEMPLATE_FIELD_ELEMENTS_LABEL"
	default='{"template":["Layout","Simple snippet"],
		"location":["layout1.html","snippet1.html"],
		"description":["HTMLLayout","Simple HTML snippet"]}'>
	<fieldset hidden="true" name="list_templates_modal" repeat="true">
		<field name="template"
			label="PLG_TINY_FIELD_TEMPLATE_FIELD_NAME_LABEL"
			size="30"
			type="text" />
		<field name="location"
			label="PLG_TINY_FIELD_TEMPLATE_FIELD_LOCATION_LABEL"
			description="PLG_TINY_FIELD_TEMPLATE_LOCATION_DESC"
			size="30"
			type="filelist"
			directory="media/editors/tinymce/templates"
			exclude="index.html"
			hide_default="true"
			hide_none="true" />
		<field name="description"
			label="PLG_TINY_FIELD_TEMPLATE_FIELD_DESCRIPTION_LABEL"
			size="30"
			type="textarea" />
	</fieldset>
</field>

Considerations for the default value[edit]

  • The default may contain spaces tabs and new lines [1] (makes for better readability)
  • The data elements within the string must be quoted using " instead of '. Failure to do so will cause the json decode to fail on the default values.

Retrieving your data[edit]

The settings of a repeatable form field are returned as a json encoded array (same as the default)

// get the repeatable field value and decode it
$list_hosts 	 = json_decode( $params->get('list_templates'),true);
// loop your result
foreach( $list_templates as $list_templates_idx => $list_template ) {
   // do something clever for each of the templates
}

References[edit]

Repeatable form field type/en[edit]


This field is deprecated

Please use the Subform form field type (in multiple mode) instead.

Provides a modal with rows of formfields that you specify. As many options can be added as desired. Note this form field has a jQuery based javascript file as a dependency.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be repeatable.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field. Displays at the top of the modal with the name as well as in the usual position in the form.
  • default The default value for the form field if the field is left empty. Note this has to be a json string compatible with the contents of the form field.
  • id id of the hidden form field. (the modal will have this id with an added suffix of "_modal" and the table within the modal will have this id with a suffix of "_modal_table").
  • class class of the table.
  • select (translatable) The text to show on the modal button.
  • icon the icon to show on the select button (is prefixed with "icon-").
  • maximum the maximum number of rows of fields allowed (by default 999 to be effectively infinite).

To create a form field you must first of all create a repeatable form field as usual.

<fields>

Within this you place open and close tag (if not already in one - if there is an existing fields tag for params etc. this is not needed.) and within this a tag.

<fieldset>

The fieldset tag MUST have a name the same as your repeatable field name with "_modal" appended to the end of it - it should also have the in the fieldset tag.

repeat="true"

Within this fieldset you then include the form fields that you wish to have repeating (as with any form field).

Example XML Definition

<field name="list_templates"
	type="repeatable"
	icon="list"
	description="PLG_TINY_FIELD_TEMPLATE_FIELD_ELEMENTS_DESC"
	label="PLG_TINY_FIELD_TEMPLATE_FIELD_ELEMENTS_LABEL"
	default='{"template":["Layout","Simple snippet"],
		"location":["layout1.html","snippet1.html"],
		"description":["HTMLLayout","Simple HTML snippet"]}'>
	<fieldset hidden="true" name="list_templates_modal" repeat="true">
		<field name="template"
			label="PLG_TINY_FIELD_TEMPLATE_FIELD_NAME_LABEL"
			size="30"
			type="text" />
		<field name="location"
			label="PLG_TINY_FIELD_TEMPLATE_FIELD_LOCATION_LABEL"
			description="PLG_TINY_FIELD_TEMPLATE_LOCATION_DESC"
			size="30"
			type="filelist"
			directory="media/editors/tinymce/templates"
			exclude="index.html"
			hide_default="true"
			hide_none="true" />
		<field name="description"
			label="PLG_TINY_FIELD_TEMPLATE_FIELD_DESCRIPTION_LABEL"
			size="30"
			type="textarea" />
	</fieldset>
</field>

Considerations for the default value[edit]

  • The default may contain spaces tabs and new lines [1] (makes for better readability)
  • The data elements within the string must be quoted using " instead of '. Failure to do so will cause the json decode to fail on the default values.

Retrieving your data[edit]

The settings of a repeatable form field are returned as a json encoded array (same as the default)

// get the repeatable field value and decode it
$list_hosts 	 = json_decode( $params->get('list_templates'),true);
// loop your result
foreach( $list_templates as $list_templates_idx => $list_template ) {
   // do something clever for each of the templates
}

References[edit]

Repeatable form field type/fa[edit]


This field is deprecated

Please use the Subform form field type (in multiple mode) instead.

Provides a modal with rows of formfields that you specify. As many options can be added as desired. Note this form field has a jQuery based javascript file as a dependency.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be repeatable.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field. Displays at the top of the modal with the name as well as in the usual position in the form.
  • default The default value for the form field if the field is left empty. Note this has to be a json string compatible with the contents of the form field.
  • id id of the hidden form field. (the modal will have this id with an added suffix of "_modal" and the table within the modal will have this id with a suffix of "_modal_table").
  • class class of the table.
  • select (translatable) The text to show on the modal button.
  • icon the icon to show on the select button (is prefixed with "icon-").
  • maximum the maximum number of rows of fields allowed (by default 999 to be effectively infinite).

To create a form field you must first of all create a repeatable form field as usual.

<fields>

Within this you place open and close tag (if not already in one - if there is an existing fields tag for params etc. this is not needed.) and within this a tag.

<fieldset>

The fieldset tag MUST have a name the same as your repeatable field name with "_modal" appended to the end of it - it should also have the in the fieldset tag.

repeat="true"

Within this fieldset you then include the form fields that you wish to have repeating (as with any form field).

Example XML Definition

<field name="list_templates"
	type="repeatable"
	icon="list"
	description="PLG_TINY_FIELD_TEMPLATE_FIELD_ELEMENTS_DESC"
	label="PLG_TINY_FIELD_TEMPLATE_FIELD_ELEMENTS_LABEL"
	default='{"template":["Layout","Simple snippet"],
		"location":["layout1.html","snippet1.html"],
		"description":["HTMLLayout","Simple HTML snippet"]}'>
	<fieldset hidden="true" name="list_templates_modal" repeat="true">
		<field name="template"
			label="PLG_TINY_FIELD_TEMPLATE_FIELD_NAME_LABEL"
			size="30"
			type="text" />
		<field name="location"
			label="PLG_TINY_FIELD_TEMPLATE_FIELD_LOCATION_LABEL"
			description="PLG_TINY_FIELD_TEMPLATE_LOCATION_DESC"
			size="30"
			type="filelist"
			directory="media/editors/tinymce/templates"
			exclude="index.html"
			hide_default="true"
			hide_none="true" />
		<field name="description"
			label="PLG_TINY_FIELD_TEMPLATE_FIELD_DESCRIPTION_LABEL"
			size="30"
			type="textarea" />
	</fieldset>
</field>

Considerations for the default value[edit]

  • The default may contain spaces tabs and new lines [1] (makes for better readability)
  • The data elements within the string must be quoted using " instead of '. Failure to do so will cause the json decode to fail on the default values.

Retrieving your data[edit]

The settings of a repeatable form field are returned as a json encoded array (same as the default)

// get the repeatable field value and decode it
$list_hosts 	 = json_decode( $params->get('list_templates'),true);
// loop your result
foreach( $list_templates as $list_templates_idx => $list_template ) {
   // do something clever for each of the templates
}

منابع[edit]

Rules form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Rules Field instead


The rules parameter type provides a matrix of group by action options for managing access control.

  • type (mandatory) must be rules.
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (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.
  • component (mandatory) indicates the component to which the action options will apply.
  • section (mandatory) indicates the section of the access.xml actions the control should apply to. For example, "component" or "my_item_type".

See also[edit]

Rules form field type/en[edit]

The rules parameter type provides a matrix of group by action options for managing access control.

  • type (mandatory) must be rules.
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (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.
  • component (mandatory) indicates the component to which the action options will apply.
  • section (mandatory) indicates the section of the access.xml actions the control should apply to. For example, "component" or "my_item_type".

See also[edit]

SQL form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual SQL Field instead


Stop hand nuvola.svg.png
Warning!

Using this generic form field type forces you to write SQL in an XML file and is rather limited. For more flexibility, consider creating your own, specific form field type by subclassing the JFormField class.


The sql form field type provides a drop down list of entries obtained by running a query on the Joomla database. If the field has a value saved, this value is selected when the page is first loaded. If not, the default value (if any) is selected.

Params.sql.jpg
  • type (mandatory) must be sql.
  • name (mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • query (mandatory if not using the sql_* attributes) is the SQL query which will provide the data for the drop-down list. The query must return two columns; one called 'value' (unless overridden by the key_field attribute) which will hold the values of the list items; the other called the same as the value of the name attribute (unless overridden by the value_field attribute) containing the text to be shown in the drop-down list.
  • default (optional) is the default value. This is the value of the 'value' column, unless overridden by the key_field attribute.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • multiple (optional) turns the field into a multi-selector. Use multiple="multiple".
  • key_field (optional) is the name of the column that will contain values for the parameter. If omitted then the column called 'value' will be used, if it exists.
  • value_field (optional) is the name of the column that will contain values to be shown to the user in the drop-down list. If omitted then the column with the same name as the name attribute will be used, if it exists.
  • translate (optional) will translate the output of the value_field if set to true. It defaults to false.
  • header (optional) (translatable) will add an entry, with an empty value, at the top of the list of options. This is usually used to add a "- Select something -" entry to the list. See the examples for an alternative way of achieving this.
  • sql_select (mandatory if not using the query attribute) is the SELECT clause of the SQL statement. Only one such clause is permitted.
  • sql_from (mandatory if not using the query attribute) is the FROM clause of the SQL statement.
  • sql_join (optional) is the LEFT JOIN clause of the SQL statement. Only one such clause is permitted.
  • sql_where (optional) is the WHERE clause of the SQL statement. Only one such clause is permitted.
  • sql_group (optional) is the GROUP BY clause of the SQL statement.
  • sql_order (optional) is the ORDER BY clause of the SQL statement.
  • sql_filter (optional) filters the list by the value of another field. A field name or a comma-separated list of field names can be given. The field names must correspond to column names in the database table being queried. See the examples for further explanation.
  • sql_default_{FIELD_NAME} (optional) is the default value used by the sql_filter attribute when the value of the {FIELD_NAME} filter has not been set. See the examples for further explanation.

Example XML parameter definition:

<field
    name="title"
    type="sql"
    default="10"
    label="Select an article"
    query="SELECT id AS value, title AS text FROM #__content"
    />

Notice that an AS clause has been used in this example because the jos_content table does not have a column called 'value'. In fact very few tables in the Joomla database have a column called 'value'. Alternatively, you can use a key_field attribute to define the column to be used instead of 'value':

<field
    name="title"
    type="sql"
    default="10"
    label="Select an article"
    query="SELECT id, title FROM #__content"
    key_field="id"
    />

This will give identical results to the previous example.

Both column names may need to be aliased. For example, suppose you want your field to be called 'myfield' instead of 'title' in the previous example. Then you can do this:

<field
    name="myfield"
    type="sql"
    default="10"
    label="Select an article"
    query="SELECT id AS value, title AS myfield FROM #__content"
    />

Or alternatively:

<field
    name="myfield"
    type="sql"
    default="10"
    label="Select an article"
    query="SELECT id, title FROM #__content"
    key_field="id"
    value_field="title"
    />

You can also assemble or calculate fields in the SQL statement. For example, suppose you wanted to append the created date/time of each article to the article title in the list. Then you could use this SQL statement:

SELECT id, concat( title, ' (', created, ')') AS title FROM #__content

You can also specify a static option in the XML using <option></option> tag. Please look at the following example.

<field
    name="myfield"
    type="sql"
    default="10"
    label="Select an article"
    query="SELECT id, title FROM #__content"
    key_field="id"
    value_field="title"
    required="true"
    >
    <option value="">Please select your option</option>
</field>

Alternatively, you can achieve the same result using the header attribute as follows:

<field
    name="myfield"
    type="sql"
    default="10"
    label="Select an article"
    query="SELECT id, title FROM #__content"
    key_field="id"
    value_field="title"
    required="true"
    header="Please select your option"
    />

Alternative query syntax[edit]

Starting with Joomla 3.5, an alternative to the query attribute allows some additional features. These features are not available if the query attribute is present. For example, this field definition:

<field
    name="example_group"
    type="sql"
    label="COM_EXAMPLE_GROUP"
    query="SELECT e.* FROM #__example AS e GROUP BY name ORDER e.id ASC"
    key_field="id"
    value_field="name"
    />

can be expressed as:

<field
    name="example_group" 
    type="sql" 
    label="COM_EXAMPLE_GROUP" 
    sql_select="e.*" 
    sql_from="#__example AS e" 
    sql_group="name" 
    sql_order="e.id ASC" 
    key_field="id"
    value_field="name" 
    />
Stop hand nuvola.svg.png
Warning!

The following feature linked fields as filters is currently not working! See Github issue 22241

One advantage to using this syntax is that it allows the use of linked fields as filters. For example, suppose you have a form containing two select lists, one called groups and the other called subgroups. The groups field is straightforward:

<field name="groups"
    type="sql"
    label="COM_EXAMPLE_GROUPS"
    sql_select="e.*"
    sql_from="#__example_groups AS e"
    sql_group="name"
    sql_order="e.id ASC"
    key_field="id"
    value_field="name"
    />

but the subgroups field includes an sql_filter attribute which refers to the groups field by name:

<field name="subgroups"
    type="sql"
    label="COM_EXAMPLE_SUBGROUPS"
    sql_select="e.*"
    sql_from="#__example_subgroups AS e"
    sql_group="name"
    sql_order="e.id ASC"
    sql_filter="groups"
    key_field="id"
    value_field="name"
    />

Then if the groups field has the value 99, the following SQL statement will be executed for the subgroups field:

SELECT e.* FROM jos_example_subgroups AS e WHERE `groups` = 99 GROUP BY `name` ORDER BY e.id ASC

To filter on multiple fields, you can use a comma-separated list of filter names in the sql_filter clause. For example, if there is a filter called groups with the value 99 and a filter called categories with the value 12, then

sql_filter="groups,categories"

will produce the SQL WHERE clause:

WHERE `groups` = 99 AND `categories` = 12

You can also define a default value for any filter that might not have a value when the field is evaluated by adding sql_default_{FIELD_NAME} attributes. For example, suppose that the default value for the groups filter is 0 and the default value for the categories filter is 0, then this definition:

<field name="subgroups"
    type="sql"
    label="COM_EXAMPLE_SUBGROUPS"
    sql_select="e.*"
    sql_from="#__example_subgroups AS e"
    sql_group="name"
    sql_order="e.id ASC"
    sql_filter="groups,categories"
    sql_default_groups="0"
    sql_default_categories="1"
    key_field="id"
    value_field="name"
    />

will produce this SQL statement when initially evaluated with no filters:

SELECT e.* FROM jos_example_subgroups AS e WHERE `groups` = 0 AND `categories` = 1 GROUP BY `name` ORDER BY e.id ASC

Note: The SQL statements will need to be correct for the type and version of the underlying database that Joomla is running on. This will most likely be a version of MySQL, but it could be something else. There is no capability to query databases other than the one Joomla itself is running on.

Note: As shown in these examples, the database prefix (often jos) should be entered in the form #__ (hash-underscore-underscore). It will automatically be replaced by the actual database prefix used by Joomla.

See also[edit]

SQL form field type/en[edit]

Stop hand nuvola.svg.png
Warning!

Using this generic form field type forces you to write SQL in an XML file and is rather limited. For more flexibility, consider creating your own, specific form field type by subclassing the JFormField class.


The sql form field type provides a drop down list of entries obtained by running a query on the Joomla database. If the field has a value saved, this value is selected when the page is first loaded. If not, the default value (if any) is selected.

Params.sql.jpg
  • type (mandatory) must be sql.
  • name (mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • query (mandatory if not using the sql_* attributes) is the SQL query which will provide the data for the drop-down list. The query must return two columns; one called 'value' (unless overridden by the key_field attribute) which will hold the values of the list items; the other called the same as the value of the name attribute (unless overridden by the value_field attribute) containing the text to be shown in the drop-down list.
  • default (optional) is the default value. This is the value of the 'value' column, unless overridden by the key_field attribute.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • multiple (optional) turns the field into a multi-selector. Use multiple="multiple".
  • key_field (optional) is the name of the column that will contain values for the parameter. If omitted then the column called 'value' will be used, if it exists.
  • value_field (optional) is the name of the column that will contain values to be shown to the user in the drop-down list. If omitted then the column with the same name as the name attribute will be used, if it exists.
  • translate (optional) will translate the output of the value_field if set to true. It defaults to false.
  • header (optional) (translatable) will add an entry, with an empty value, at the top of the list of options. This is usually used to add a "- Select something -" entry to the list. See the examples for an alternative way of achieving this.
  • sql_select (mandatory if not using the query attribute) is the SELECT clause of the SQL statement. Only one such clause is permitted.
  • sql_from (mandatory if not using the query attribute) is the FROM clause of the SQL statement.
  • sql_join (optional) is the LEFT JOIN clause of the SQL statement. Only one such clause is permitted.
  • sql_where (optional) is the WHERE clause of the SQL statement. Only one such clause is permitted.
  • sql_group (optional) is the GROUP BY clause of the SQL statement.
  • sql_order (optional) is the ORDER BY clause of the SQL statement.
  • sql_filter (optional) filters the list by the value of another field. A field name or a comma-separated list of field names can be given. The field names must correspond to column names in the database table being queried. See the examples for further explanation.
  • sql_default_{FIELD_NAME} (optional) is the default value used by the sql_filter attribute when the value of the {FIELD_NAME} filter has not been set. See the examples for further explanation.

Example XML parameter definition:

<field
    name="title"
    type="sql"
    default="10"
    label="Select an article"
    query="SELECT id AS value, title AS text FROM #__content"
    />

Notice that an AS clause has been used in this example because the jos_content table does not have a column called 'value'. In fact very few tables in the Joomla database have a column called 'value'. Alternatively, you can use a key_field attribute to define the column to be used instead of 'value':

<field
    name="title"
    type="sql"
    default="10"
    label="Select an article"
    query="SELECT id, title FROM #__content"
    key_field="id"
    />

This will give identical results to the previous example.

Both column names may need to be aliased. For example, suppose you want your field to be called 'myfield' instead of 'title' in the previous example. Then you can do this:

<field
    name="myfield"
    type="sql"
    default="10"
    label="Select an article"
    query="SELECT id AS value, title AS myfield FROM #__content"
    />

Or alternatively:

<field
    name="myfield"
    type="sql"
    default="10"
    label="Select an article"
    query="SELECT id, title FROM #__content"
    key_field="id"
    value_field="title"
    />

You can also assemble or calculate fields in the SQL statement. For example, suppose you wanted to append the created date/time of each article to the article title in the list. Then you could use this SQL statement:

SELECT id, concat( title, ' (', created, ')') AS title FROM #__content

You can also specify a static option in the XML using <option></option> tag. Please look at the following example.

<field
    name="myfield"
    type="sql"
    default="10"
    label="Select an article"
    query="SELECT id, title FROM #__content"
    key_field="id"
    value_field="title"
    required="true"
    >
    <option value="">Please select your option</option>
</field>

Alternatively, you can achieve the same result using the header attribute as follows:

<field
    name="myfield"
    type="sql"
    default="10"
    label="Select an article"
    query="SELECT id, title FROM #__content"
    key_field="id"
    value_field="title"
    required="true"
    header="Please select your option"
    />

Alternative query syntax[edit]

Starting with Joomla 3.5, an alternative to the query attribute allows some additional features. These features are not available if the query attribute is present. For example, this field definition:

<field
    name="example_group"
    type="sql"
    label="COM_EXAMPLE_GROUP"
    query="SELECT e.* FROM #__example AS e GROUP BY name ORDER e.id ASC"
    key_field="id"
    value_field="name"
    />

can be expressed as:

<field
    name="example_group" 
    type="sql" 
    label="COM_EXAMPLE_GROUP" 
    sql_select="e.*" 
    sql_from="#__example AS e" 
    sql_group="name" 
    sql_order="e.id ASC" 
    key_field="id"
    value_field="name" 
    />
Stop hand nuvola.svg.png
Warning!

The following feature linked fields as filters is currently not working! See Github issue 22241

One advantage to using this syntax is that it allows the use of linked fields as filters. For example, suppose you have a form containing two select lists, one called groups and the other called subgroups. The groups field is straightforward:

<field name="groups"
    type="sql"
    label="COM_EXAMPLE_GROUPS"
    sql_select="e.*"
    sql_from="#__example_groups AS e"
    sql_group="name"
    sql_order="e.id ASC"
    key_field="id"
    value_field="name"
    />

but the subgroups field includes an sql_filter attribute which refers to the groups field by name:

<field name="subgroups"
    type="sql"
    label="COM_EXAMPLE_SUBGROUPS"
    sql_select="e.*"
    sql_from="#__example_subgroups AS e"
    sql_group="name"
    sql_order="e.id ASC"
    sql_filter="groups"
    key_field="id"
    value_field="name"
    />

Then if the groups field has the value 99, the following SQL statement will be executed for the subgroups field:

SELECT e.* FROM jos_example_subgroups AS e WHERE `groups` = 99 GROUP BY `name` ORDER BY e.id ASC

To filter on multiple fields, you can use a comma-separated list of filter names in the sql_filter clause. For example, if there is a filter called groups with the value 99 and a filter called categories with the value 12, then

sql_filter="groups,categories"

will produce the SQL WHERE clause:

WHERE `groups` = 99 AND `categories` = 12

You can also define a default value for any filter that might not have a value when the field is evaluated by adding sql_default_{FIELD_NAME} attributes. For example, suppose that the default value for the groups filter is 0 and the default value for the categories filter is 0, then this definition:

<field name="subgroups"
    type="sql"
    label="COM_EXAMPLE_SUBGROUPS"
    sql_select="e.*"
    sql_from="#__example_subgroups AS e"
    sql_group="name"
    sql_order="e.id ASC"
    sql_filter="groups,categories"
    sql_default_groups="0"
    sql_default_categories="1"
    key_field="id"
    value_field="name"
    />

will produce this SQL statement when initially evaluated with no filters:

SELECT e.* FROM jos_example_subgroups AS e WHERE `groups` = 0 AND `categories` = 1 GROUP BY `name` ORDER BY e.id ASC

Note: The SQL statements will need to be correct for the type and version of the underlying database that Joomla is running on. This will most likely be a version of MySQL, but it could be something else. There is no capability to query databases other than the one Joomla itself is running on.

Note: As shown in these examples, the database prefix (often jos) should be entered in the form #__ (hash-underscore-underscore). It will automatically be replaced by the actual database prefix used by Joomla.

See also[edit]

Sessionhandler form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Sessionhandler Field instead


Provides a dropdown list of session handler options.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be sessionhandler.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field.
  • default (optional) provides a default value.
  • required (optional) "true" to enforce a value.
  • filter (optional) cleans the input.

Example XML Definition:

<field name="session_handler" type="sessionhandler"
	default="none"
	label="COM_CONFIG_FIELD_SESSION_HANDLER_LABEL"
	description="COM_CONFIG_FIELD_SESSION_HANDLER_DESC"
	required="true"
	filter="word" />

Sessionhandler form field type/en[edit]

Provides a dropdown list of session handler options.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be sessionhandler.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field.
  • default (optional) provides a default value.
  • required (optional) "true" to enforce a value.
  • filter (optional) cleans the input.

Example XML Definition:

<field name="session_handler" type="sessionhandler"
	default="none"
	label="COM_CONFIG_FIELD_SESSION_HANDLER_LABEL"
	description="COM_CONFIG_FIELD_SESSION_HANDLER_DESC"
	required="true"
	filter="word" />

Spacer form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Spacer Field instead


The spacer form field type provides a visual separator between parameter field elements. It is purely a visual aid and no field value is stored.

Params.spacer.jpg
  • type (mandatory) must be spacer.
  • name (mandatory) is the unique name of the field.
  • label (optional) (translatable) is the text to use as a spacer.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • hr (optional) is whether to display a horizontal rule ('true' or 'false'). If this attribute is 'true', the label attribute will be ignored.
  • class (optional) is a CSS class name for the HTML form field.

Example XML field definition:

<field type="spacer" name="myspacer" hr="true" />

You can replace the basic horizontal line with a title which can be used to group parameters. For example,

<field type="spacer" name="myspacer" label="Advanced parameters" />

You can also place translatable text into the label attribute:

<field type="spacer" name="myspacer" class="text"
label="PLG_TINY_FIELD_NAME_EXTENDED_LABEL"
/>

Note that you can also include HTML markup but it must be encoded. For example, to put the text into bold you can use:

<field type="spacer" name="myspacer" label="&lt;b&gt;Advanced parameters&lt;/b&gt;" />

You cannot combine the hr and label attributes. To define a spacer with both a horizontal rule and a label, use an encoded <hr/> in the label attribute:

<field type="spacer" name="myspacer" label="&lt;hr/&gt;More parameters" />

See also[edit]

Spacer form field type/en[edit]

The spacer form field type provides a visual separator between parameter field elements. It is purely a visual aid and no field value is stored.

Params.spacer.jpg
  • type (mandatory) must be spacer.
  • name (mandatory) is the unique name of the field.
  • label (optional) (translatable) is the text to use as a spacer.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • hr (optional) is whether to display a horizontal rule ('true' or 'false'). If this attribute is 'true', the label attribute will be ignored.
  • class (optional) is a CSS class name for the HTML form field.

Example XML field definition:

<field type="spacer" name="myspacer" hr="true" />

You can replace the basic horizontal line with a title which can be used to group parameters. For example,

<field type="spacer" name="myspacer" label="Advanced parameters" />

You can also place translatable text into the label attribute:

<field type="spacer" name="myspacer" class="text"
label="PLG_TINY_FIELD_NAME_EXTENDED_LABEL"
/>

Note that you can also include HTML markup but it must be encoded. For example, to put the text into bold you can use:

<field type="spacer" name="myspacer" label="&lt;b&gt;Advanced parameters&lt;/b&gt;" />

You cannot combine the hr and label attributes. To define a spacer with both a horizontal rule and a label, use an encoded <hr /> in the label attribute:

<field type="spacer" name="myspacer" label="&lt;hr/&gt;More parameters" />

See also[edit]

Spacer form field type/pl[edit]

Typ dystansowy pola formularza zapewnia wizualny separator między elementami pól parametrów. Jest to wyłącznie pomoc wizualna i nie jest przechowywana żadna wartość pola.

Params.spacer.jpg
  • type (obowiązkowo) musi być spacer.
  • name (obowiązkowo) to unikalna nazwa pola.
  • label (opcjonalnie) (przetłumaczalny) to tekst, który ma być użyty jako odstęp.
  • description (opcjonalnie) (przetłumaczalny) to tekst, który będzie wyświetlany jako podpowiedź, gdy użytkownik przesunie mysz nad rozwijanym polem.
  • hr (opcjonalnie) oznacza, czy wyświetlać regułę poziomą ('true' lub 'false'). Jeżeli atrybut ten ma wartość 'true', atrybut label zostanie zignorowany.
  • class (opcjoalnie) jest nazwą klasy CSS dla pola formularza HTML.

Przykładowa definicja pola XML:

<field type="spacer" name="myspacer" hr="true" />

Możesz zastąpić podstawową linię poziomą tytułem, który może być użyty do grupowania parametrów. Na przykład,

<field type="spacer" name="myspacer" label="Advanced parameters" />

Możesz również umieścić przetłumaczalny tekst w atrybucie etykiety:

<field type="spacer" name="myspacer" class="text"
label="PLG_TINY_FIELD_NAME_EXTENDED_LABEL"
/>

Zauważ, że możesz również dołączyć znacznik HTML, ale musi on być zakodowany. Na przykład, aby pogrubić tekst możesz użyć:

<field type="spacer" name="myspacer" label="&lt;b&gt;Advanced parameters&lt;/b&gt;" />

Nie można łączyć atrybutów hr i label. Aby zdefiniować odstępnik zarówno z regułą poziomą, jak i etykietą, użyj zakodowanego polecenia <hr/> w atrybucie label:

<field type="spacer" name="myspacer" label="&lt;hr/&gt;More parameters" />

Zobacz także[edit]

Subform form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Subform Field instead


The subform form field type provides a method for using XML forms inside one another or reuse forms inside an existing form. If attribute multiple is set to true then the included form will be repeatable.

The Field has two "predefined" layouts for displaying the subform as either a table or as a div container, as well as support for custom layouts.

An example XML field definition for single mode:

<field name="field-name" type="subform"
    formsource="path/to/exampleform.xml"
    label="Subform Field" description="Subform Field Description" />

An example XML field definition for multiple mode:

<field name="field-name" type="subform"
    formsource="path/to/exampleform.xml" multiple="true"
    label="Subform Field" description="Subform Field Description" />

Example XML of exampleform.xml

<?xml version="1.0" encoding="UTF-8"?>
<form>
    <field name="example_text" type="text" label="Example Text" />
    <field name="example_textarea" type="textarea" label="Example Textarea" cols="40" rows="8" />
</form>

An example XML of exampleform.xml with fieldsets

<?xml version="1.0" encoding="UTF-8"?>
<form>
    <fieldset name="section1" label="Section1">
        <field name="example_text" type="text" label="Example Text" />
        <field name="example_textarea" type="textarea" label="Example Textarea" cols="40" rows="8" />
    </fieldset>
    <fieldset name="section2" label="Section2">
        <field name="example_list" type="list" default="1" class="advancedSelect" label="Example List">
            <option value="1">JYES</option>
            <option value="0">JNO</option>
        </field>
    </fieldset>
</form>

The subform XML may also be specified inline as an alternative to placing the subform XML in a separate file. The following example illustrates this:

<?xml version="1.0" encoding="UTF-8"?>
<field
	name="field-name"
	type="subform"
	label="Subform Field"
	description="Subform Field Description"
	multiple="true"
	min="1"
	max="10"
	>
	<form>
		<field
			name="example_text"
			type="text"
			label="Example Text"
			/>
		<field
			name="example_textarea"
			type="textarea"
			label="Example Textarea"
			cols="40"
			rows="8"
			/>
	</form>
</field>

Field attributes:

  • type (mandatory) must be subform.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (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.
  • required (optional) The field must be filled before submitting the form.
  • message (optional) The error message that will be displayed instead of the default message.
  • default (optional) is the default value, JSON string.
  • formsource (mandatory) the form source to be included. A relative path to the xml file (relative to the root folder for the installed Joomla site) or a valid form name which can be found by JForm::getInstance().
  • multiple (optional) whether the subform fields are repeatable or not.
  • min (optional) count of minimum repeating in multiple mode. Default: 0.
  • max (optional) count of maximum repeating in multiple mode. Default: 1000.
  • groupByFieldset (optional) whether to group the subform fields by its fieldset (true or false). Default: false.
  • buttons (optional) which buttons to show in multiple mode. Default: add,remove,move.
  • layout (optional) the name of the layout to use when displaying subform fields.
  • validate (optional) should be set to Subform (note that this is case-sensitive!) to ensure that fields in the subform are individually validated. Default: Fields in the subform are not validated, even if validation rules are specified.

Available layouts:

  • joomla.form.field.subform.default render the subform in a div container, without support of repeating. Default for single mode.
  • joomla.form.field.subform.repeatable render the subform in a div container, used for multiple mode. Support groupByFieldset.
  • joomla.form.field.subform.repeatable-table render the subform as a table, used for multiple mode. Supports groupByFieldset. By default each field is rendered as a table column, but if groupByFieldset=true then each fieldset is rendered as a table column.

Be aware

If your field in the subform has additional JavaScript logic then it may not work in multiple mode, because do not see the fields which added by the subform field dynamically. If it happened then you need to adjust your field to support it. Next example may help:

jQuery(document).ready(function(){
    ... here the code for setup your field as usual...

    jQuery(document).on('subform-row-add', function(event, row){
        ... here is the code to set up the fields in the new row ...
    })
});

Because of this some extra Joomla! fields may not work for now.

Fields Validation and Filters[edit]

The subform form field does not provide the Validation and Filters for child fields.

Addition: Since a security fix in Joomla 3.9.7 the filter="example" attributes in subform child fields are supported and the fields will be validated; but NOT in custom form fields that extend the JFormFieldSubform class. You have to adapt such custom fields yourself!

Beware![edit]

All extensions that use subform fields MUST add an attribute filter to their subform child fields of type editor, textarea, text (maybe others, too) since Joomla 3.9.7 like it's common for "normal" JForm fields, if you want to allow HTML input. Otherwise the validation falls back to STRING, which is the common behavior for "normal" JForm fields. Examples:

filter="safehtml"
filter="JComponentHelper::filterText"
filter="raw" (bad decision in most cases)

Example[edit]

Problem

After adding new rows selects are not "chosen".

Solution

Here is an example how to reinit jQuery Chosen on newly added repeated rows:

jQuery(document).ready(function(){
    jQuery(document).on('subform-row-add', function(event, row){
        jQuery(row).find('select').chosen();
    })
});

Or a PHP snippet to be used in e.g. your plugin in **onBeforeCompileHead** method or in your component view.

$doc = JFactory::getDocument();
$js = '
	jQuery(document).on(\'subform-row-add\', function(event, row){
		jQuery(row).find(\'select\').chosen();
	})
';
$doc->addScriptDeclaration($js);

So newly added rows now are "chosen" now

Problem

Subform data not getting stored to database on custom component.

Solution

Add the following line to the beginning of your corresponding table class:

protected $_jsonEncode = array('fieldnamehere');

More information Here.

See also[edit]

Subform form field type/en[edit]

Please someone, copy this to the docs.joomla.org/index.php?title=Subform_form_field_type thanks!

The subform form field type provides a way to use XML forms inside each other or reuse your existing forms inside your current form. The field allow to include any existing form into the current form. If attribute multiple set to true then the included form will be repeatable.

The Field have a couple "predefined" layouts for display the subform as table or as div container, and of course it allow to use your own layout.

Field support Default values from the included form, and from json string in default attribute. Last have higher priority.


Example XML field definition for single mode:

<field name="field-name" type="subform"
    formsource="path/to/exampleform.xml"
    label="Subform Field" description="Subform Field Description" />

Example XML field definition for multiple mode:

<field name="field-name" type="subform"
    formsource="path/to/exampleform.xml" multiple="true"
    label="Subform Field" description="Subform Field Description" />

Example XML of exampleform.xml

<?xml version="1.0" encoding="UTF-8"?>
<form>
    <field name="example_text" type="text" label="Example Text" />
    <field name="example_textarea" type="textarea" label="Example Textarea" cols="40" rows="8" />
</form>

Example XML of exampleform.xml with fieldsets

<?xml version="1.0" encoding="UTF-8"?>
<form>
    <fieldset name="section1" label="Section1">
        <field name="example_text" type="text" label="Example Text" />
        <field name="example_textarea" type="textarea" label="Example Textarea" cols="40" rows="8" />
    </fieldset>
    <fieldset name="section2" label="Section2">
        <field name="example_list" type="list" default="1" class="advancedSelect" label="Example List">
            <option value="1">JYES</option>
            <option value="0">JNO</option>
        </field>
    </fieldset>
</form>

Field attributes:

  • type (mandatory) must be subform.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (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.
  • required (optional) The field must be filled before submitting the form.
  • message (optional) The error message that will be displayed instead of the default message.
  • default (optional) is the default value, JSON string.
  • formsource (mandatory) the form source to be included. Path to xml file or the form name to search by JForm::getInstance().
  • multiple (optional) the multiple state for the form field. Whether the subform will repeatable or not.
  • min (optional) count of minimum repeating in multiple mode. Default: 0.
  • max (optional) count of maximum repeating in multiple mode. Default: 1000.
  • groupByFieldset (optional) whether group the subform fields by it`s fieldset (true or false). Default: false.
  • buttons (optional) which buttons to show in multiple mode. Default: add,remove,move.
  • layout (optional) the layout name for render the subform inputs.

Available layouts:

  • joomla.form.field.subform.default render the subform in div container, without support of repeating. Default for single mode.
  • joomla.form.field.subform.repeatable render the subform in div container, used for multiple mode. Support groupByFieldset.
  • joomla.form.field.subform.repeatable-table render the subform as table, can be used for multiple mode. Support groupByFieldset. By default render each field as the table column, but if groupByFieldset=true then render each fieldset as the table column.


Be aware

If your field in the subform has addittional JavaScript logic then it may not work in multiple mode, because do not see the fields which added by the subform field dynamically. If it happened then you need to adjust your field to support it. Next example may help:

jQuery(document).ready(function(){
    ... here the code for setup your field as usual...

    jQuery(document).on('subform-row-add', function(event, row){
        ... here is the code to set up the fields in the new row ...
    })
});

Because of this some extra Joomla! fields may not work for now.


See also[edit]

Tag form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Tag Field instead


The Tag field type provides a point where you can enter tags - this is either AJAX or nested.

  • type (mandatory) must be tag.
  • name (mandatory) is the unique name of the parameter.
  • mode (optional) (translatable) is the description of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) is the description of the field.
  • id (optional) is the id to add to the field. Note if none is set this will be the name of the field.
  • class (optional) is the class to add to the field.
  • published (optional) determines if non published tags should be allowed.
  • language (optional) is language to filter the existing tags by.
  • multiple (optional) is the ability to add more than 1 tag to the form field.
  • custom (optional) if the ajax mode is chosen setting this to deny will prevent users from adding in new tags.

Example XML Definition for an AJAX Tag

<field name="tags" type="tag" label="JTAG" description="JTAG_DESC" mode="ajax" class="inputbox span12 small" multiple="true" />

Example XML Definition for an Nested Tag

<field name="tags" type="tag" label="JTAG" description="JTAG_DESC" mode="nested" class="inputbox span12 small" multiple="true" />

See also[edit]

Joomla! Community Magazine April 2013 Issue

Tag form field type/en[edit]

The Tag field type provides a point where you can enter tags - this is either AJAX or nested.

  • type (mandatory) must be tag.
  • name (mandatory) is the unique name of the parameter.
  • mode (optional) (translatable) is the description of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) is the description of the field.
  • id (optional) is the id to add to the field. Note if none is set this will be the name of the field.
  • class (optional) is the class to add to the field.
  • published (optional) determines if non published tags should be allowed.
  • language (optional) is language to filter the existing tags by.
  • multiple (optional) is the ability to add more than 1 tag to the form field.
  • custom (optional) if the ajax mode is chosen setting this to deny will prevent users from adding in new tags.

Example XML Definition for an AJAX Tag

<field name="tags" type="tag" label="JTAG" description="JTAG_DESC" mode="ajax" class="inputbox span12 small" multiple="true" />

Example XML Definition for an Nested Tag

<field name="tags" type="tag" label="JTAG" description="JTAG_DESC" mode="nested" class="inputbox span12 small" multiple="true" />

See also[edit]

Joomla! Community Magazine April 2013 Issue

Templatestyle form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Templatestyle Field instead


Provides a dropdown list of style options.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be templatestyle.
  • client (optional) administrator, defaults to site.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field.
  • class (optional) for styling.
  • multiple (optional) is whether multiple items can be selected at the same time (true or false). In Joomla 4 it is recommended to use additionally layout="joomla.form.field.groupedlist-fancy-select" in the field declaration (= chosen replacement).

Example XML Definition :

<field name="admin_style" type="templatestyle"
	client="administrator"
	description="COM_ADMIN_USER_FIELD_BACKEND_TEMPLATE_DESC"
	label="COM_ADMIN_USER_FIELD_BACKEND_TEMPLATE_LABEL" >
		<option value="">JOPTION_USE_DEFAULT</option>
</field>

Templatestyle form field type/de[edit]

Provides a dropdown list of style options.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be templatestyle.
  • client (optional) administrator, defaults to site.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field.
  • class (optional) for styling.

Example XML Definition :

<field name="admin_style" type="templatestyle"
	client="administrator"
	description="COM_ADMIN_USER_FIELD_BACKEND_TEMPLATE_DESC"
	label="COM_ADMIN_USER_FIELD_BACKEND_TEMPLATE_LABEL" >
		<option value="">JOPTION_USE_DEFAULT</option>
</field>

Templatestyle form field type/en[edit]

Provides a dropdown list of style options.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be templatestyle.
  • client (optional) administrator, defaults to site.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field.
  • class (optional) for styling.

Example XML Definition :

<field name="admin_style" type="templatestyle"
	client="administrator"
	description="COM_ADMIN_USER_FIELD_BACKEND_TEMPLATE_DESC"
	label="COM_ADMIN_USER_FIELD_BACKEND_TEMPLATE_LABEL" >
		<option value="">JOPTION_USE_DEFAULT</option>
</field>

Templatestyle form field type/es[edit]

Proporciona una lista desplegable de opciones de estilo.

  • name (obligatorio) es el nombre único del parámetro.
  • type (obligatorio) debe ser templatestyle.
  • cliente (opcional) administrador, valor por defecto del sitio.
  • label (obligatoria) (traducible) es el título descriptivo del campo.
  • description texto descriptivo para el campo de formulario.
  • class (opcional) para el estilo.

Ejemplo de Definición XML:

<field name="admin_style" type="templatestyle"
	client="administrator"
	description="COM_ADMIN_USER_FIELD_BACKEND_TEMPLATE_DESC"
	label="COM_ADMIN_USER_FIELD_BACKEND_TEMPLATE_LABEL" >
		<option value="">JOPTION_USE_DEFAULT</option>
</field>

Text form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Text Field instead


The text form field type provides a text box for data entry. 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 selected.

Params.text.jpg
  • type (mandatory) must be text.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • size (optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.
  • maxlength (optional) limits the number of characters that may be entered.
  • default (optional) (not translatable) is the default value.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'text_area'.
  • readonly (optional) The field cannot be changed and will automatically inherit the default value. (Possible values: "true", "1", "readonly" to set to true)
  • disabled (optional) The field cannot be changed and will automatically inherit the default value - it will also not submit. (Possible values: "true", "1", "readonly" to set to true)
  • required (optional) The field must be filled before submitting the form. (Possible values: "true", "1", "readonly" to set to true)
  • filter (optional) allow the system to save certain html tags or raw data.
  • message (optional) The error message that will be displayed instead of the default message.
  • hint (optional) The text displayed in the html placeholder element, usually a lighter coloured hint displayed inside an blank field.
  • inputtype (optional) Set the HTML5 input type
  • pattern (optional) A regular expression pattern to use for validation.
  • charcounter (optional) (Joomla 4.3) Whether to show a character counter (true or false). Use in conjunction with maxlength. Default: false.

The Text field can also take an array of option sub elements in order to show suggestions to user in the text field.

Example XML field definition:

<field name="mytextvalue" type="text" default="Some text" label="Enter some text" description="" size="10" />

Use the integer filter to ensure that letters types get stripped when the form is processed.

<field name="myintvalue" type="text" default="8" label="Enter some text" description="Enter some description" filter="integer" />

Use the raw filter to ensure that html code is preserved when the form is processed.

<field name="myhtmlvalue" type="text" default="" label="Enter some text" description="Enter some description" filter="raw" />

See also[edit]

Text form field type/de[edit]


The text form field type provides a text box for data entry. 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 selected.

Params.text.jpg
  • type (mandatory) must be text.
  • name (obligatorisch) ist der eindeutige Name des Feldes.
  • label (obligatorisch) (übersetzbar) ist der beschreibende Titel des Feldes.
  • size' (optional) ist die Breite des Textfeldes in (alphanumerischen) Zeichen. Wird es weggelassen, gilt die Browsereinstellung. Dieser Wert begrenzt nicht die Menge der Zeichen, die eingegeben werden können.
  • maxlength' (optional) begrenzt die Anzahl der Zeichen, die eingegeben werden können.
default' (optional) (nicht übersetzbar) ist der Standardwert.
  • Beschreibung (optional) (übersetzbar) ist der Text, der als Tooltip als Mouse-over Effekt über die Dropdown-Box angezeigt wird.
  • class' (optional) ist ein CSS-Klassenname für das HTML-Formularfeld. Wird es weggelasen, verwendet Joomla! standardmäßig 'text_area'.
  • Readonly'' (optional) Das Feld kann nicht geändert werden und erbt automatisch den Standardwert. (Mögliche Werte: "true", "1", "readonly", um auf true zu setzen)
  • Das Feld kann nicht geändert werden und erbt automatisch den Standardwert - es wird auch nicht gesendet. (Mögliche Werte: "true", "1", "readonly", um auf true zu setzen)
  • required (optional) Das Feld muss vor dem Absenden des Formulars ausgefüllt werden. (Mögliche Werte: "true", "1", "readonly", um auf true zu setzen)
  • filter' (optional) ermöglicht Joomla!, bestimmte HTML-Tags oder Rohdaten zu speichern.
  • message (optional) Die Fehlermeldung, die anstelle der Standardmeldung angezeigt wird.
  • Hinweis' (optional) Der Text, der im HTML-Platzhalterelement angezeigt wird, normalerweise ein hellerer Hinweis, der in einem leeren Feld angezeigt wird.
  • inputtype (optional) Stellen Sie den HTML5-Eingabetyp ein.
  • pattern' (optional) Ein Muster für reguläre Ausdrücke, das für die Validierung verwendet wird.

The Text field can also take an array of option sub elements in order to show suggestions to user in the text field.

Beispiel XML-Felddefinitionen:

<field name="mytextvalue" type="text" default="Some text" label="Enter some text" description="" size="10" />

Use the integer filter to ensure that letters types get stripped when the form is processed.

<field name="myintvalue" type="text" default="8" label="Enter some text" description="Enter some description" filter="integer" />

Use the raw filter to ensure that html code is preserved when the form is processed.

<field name="myhtmlvalue" type="text" default="" label="Enter some text" description="Enter some description" filter="raw" />

See also[edit]

Text form field type/en[edit]


The text form field type provides a text box for data entry. 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 selected.

Params.text.jpg
  • type (mandatory) must be text.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • size (optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.
  • maxlength (optional) limits the number of characters that may be entered.
  • default (optional) (not translatable) is the default value.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'text_area'.
  • readonly (optional) The field cannot be changed and will automatically inherit the default value. (Possible values: "true", "1", "readonly" to set to true)
  • disabled (optional) The field cannot be changed and will automatically inherit the default value - it will also not submit. (Possible values: "true", "1", "readonly" to set to true)
  • required (optional) The field must be filled before submitting the form. (Possible values: "true", "1", "readonly" to set to true)
  • filter (optional) allow the system to save certain html tags or raw data.
  • message (optional) The error message that will be displayed instead of the default message.
  • hint (optional) The text displayed in the html placeholder element, usually a lighter coloured hint displayed inside an blank field.
  • inputtype (optional) Set the HTML5 input type
  • pattern (optional) A regular expression pattern to use for validation.

The Text field can also take an array of option sub elements in order to show suggestions to user in the text field.

Example XML field definition:

<field name="mytextvalue" type="text" default="Some text" label="Enter some text" description="" size="10" />

Use the integer filter to ensure that letters types get stripped when the form is processed.

<field name="myintvalue" type="text" default="8" label="Enter some text" description="Enter some description" filter="integer" />

Use the raw filter to ensure that html code is preserved when the form is processed.

<field name="myhtmlvalue" type="text" default="" label="Enter some text" description="Enter some description" filter="raw" />

See also[edit]

Textarea form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Textarea Field instead


The textarea form field type provides a text area for entry of multi-line text. 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 selected.

Params.textarea.jpg
  • type (mandatory) must be textarea.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • rows (mandatory) is the height of the visible text area in lines. If omitted the height is determined by the browser. The value of rows does not limit the number of lines that may be entered.
  • cols (mandatory) is the width of the visible text area in characters. If omitted the width is determined by the browser. The value of cols does not limit the number of characters that may be entered.
  • default (optional) (not translatable) is the default value.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'text_area'.
  • filter (optional) allow the system to save certain html tags or raw data.
  • hint (optional) The text displayed in the html placeholder element, usually a lighter coloured hint displayed inside an blank field.

Example XML field definition:

<field name="mytextarea" type="textarea" default="default" label="Enter some text" description="" rows="10" cols="5" />

Use the raw filter to ensure that html code is preserved when the form is processed:

<field name="mytextarea" type="textarea" default="default" label="Enter some html" description="" rows="10" cols="5" filter="raw"/>

Tips[edit]

  • If you need to line break just encode <br /> in the XML config file like this: &lt;br /&gt;
  • If you need a new line character in your default value, add &#13;&#10; to the default parameter.

See also[edit]

Textarea form field type/de[edit]

The textarea form field type provides a text area for entry of multi-line text. 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 selected.

Params.textarea.jpg
  • type (mandatory) must be textarea.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • rows (mandatory) is the height of the visible text area in lines. If omitted the height is determined by the browser. The value of rows does not limit the number of lines that may be entered.
  • cols (mandatory) is the width of the visible text area in characters. If omitted the width is determined by the browser. The value of cols does not limit the number of characters that may be entered.
  • default (optional) (not translatable) is the default value.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'text_area'.
  • filter (optional) allow the system to save certain html tags or raw data.
  • hint (optional) The text displayed in the html placeholder element, usually a lighter coloured hint displayed inside an blank field.

Example XML field definition:

<field name="mytextarea" type="textarea" default="default" label="Enter some text" description="" rows="10" cols="5" />

Use the raw filter to ensure that html code is preserved when the form is processed:

<field name="mytextarea" type="textarea" default="default" label="Enter some html" description="" rows="10" cols="5" filter="raw"/>

Tips[edit]

  • If you need to line break just encode <br /> in the XML config file like this: &lt;br /&gt;
  • If you need a new line character in your default value, add &#13;&#10; to the default parameter.

See also[edit]

Textarea form field type/en[edit]

The textarea form field type provides a text area for entry of multi-line text. 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 selected.

Params.textarea.jpg
  • type (mandatory) must be textarea.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • rows (mandatory) is the height of the visible text area in lines. If omitted the height is determined by the browser. The value of rows does not limit the number of lines that may be entered.
  • cols (mandatory) is the width of the visible text area in characters. If omitted the width is determined by the browser. The value of cols does not limit the number of characters that may be entered.
  • default (optional) (not translatable) is the default value.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'text_area'.
  • filter (optional) allow the system to save certain html tags or raw data.
  • hint (optional) The text displayed in the html placeholder element, usually a lighter coloured hint displayed inside an blank field.

Example XML field definition:

<field name="mytextarea" type="textarea" default="default" label="Enter some text" description="" rows="10" cols="5" />

Use the raw filter to ensure that html code is preserved when the form is processed:

<field name="mytextarea" type="textarea" default="default" label="Enter some html" description="" rows="10" cols="5" filter="raw"/>

Tips[edit]

  • If you need to line break just encode <br /> in the XML config file like this: &lt;br /&gt;
  • If you need a new line character in your default value, add &#13;&#10; to the default parameter.

See also[edit]

Timezone form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Timezone Field instead


The timezone form field type provides a drop down list of time zones. 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 selected.

Params.timezones.jpg
  • type (mandatory) must be timezone.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) (translatable) is the default time zone. For example, use '-10' for '(UTC -10:00) Hawaii'.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.

Example XML field definition:

<field name="mytimezone" type="timezone" default="-10" label="Select a timezone" description="" />

See also[edit]

Timezone form field type/de[edit]

The timezone form field type provides a drop down list of time zones. 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 selected.

Params.timezones.jpg
  • type (mandatory) must be timezone.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) (translatable) is the default time zone. For example, use '-10' for '(UTC -10:00) Hawaii'.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.

Example XML field definition:

<field name="mytimezone" type="timezone" default="-10" label="Select a timezone" description="" />

See also[edit]

Timezone form field type/en[edit]

The timezone form field type provides a drop down list of time zones. 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 selected.

Params.timezones.jpg
  • type (mandatory) must be timezone.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) (translatable) is the default time zone. For example, use '-10' for '(UTC -10:00) Hawaii'.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.

Example XML field definition:

<field name="mytimezone" type="timezone" default="-10" label="Select a timezone" description="" />

See also[edit]

URL form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual URL Field instead


This field essentially is a text field with the type of url. If a fully qualified url (that is one with a scheme and domain such as http://example.com) is entered and it uses idn (that is uses characters that are non ascii such as ê or Ψ) it will translate the url into punycode prior to saving. This ensures that the url will work as intended regardless of environment. If you want to render field data in idn you should wrap it with the conversion method :

JStringPunycode::urlToUTF8($this->contact->webpage)

.

  • type (mandatory) must be url.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • size (optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.
  • maxlength (optional) limits the number of characters that may be entered.
  • default (optional) (not translatable) is the default value.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'text_area'.
  • readonly (optional) The field cannot be changed and will automatically inherit the default value.
  • disabled (optional) The field cannot be changed and will automatically inherit the default value - it will also not submit.
  • required (optional) The field must be filled before submitting the form.
  • filter (optional) allow the system to save certain html tags or raw data.
  • validate (optional) makes a validation
  • relative (optional) set to true for relative URLs
  • hint (optional) The text displayed in the html placeholder element, usually a lighter coloured hint displayed inside a blank field

Example XML field definition:

<field name="mytextvalue" type="url" default="http://www.example.com" label="Enter a URL" description="" size="10" />

Both a url rule and a url input filter can assist with this insuring that valid url data are entered into this field field.

See also[edit]

User Group List form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual Usergrouplist Field instead


The usergrouplist form field type provides a dropdown select box of user groups.

  • type (mandatory) must be usergrouplist.
  • name (mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.
  • label (mandatory) (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.
  • layout (optional) (translatable) is the layout, for example joomla.form.field.list-fancy-select.
  • checksuperusergroup (optional) is boolean to omit Super User groups. Values 1 or 0.
  • default (optional) is the usergroup id of the default selection in the dropdown list.
  • multiple (optional) If set to true then allows more than one usergroup to be selected.

Implemented by: libraries/src/Form/Field/UsergrouplistField.php

Example of usergrouplist form field definition:

	<field
		name="usergroup"
		type="UserGroupList"
		label="MOD_EXAMPLE_USERGROUP_LABEL"
		description="MOD_EXAMPLE_USERGROUP_DESC"
		layout="joomla.form.field.list-fancy-select"
		checksuperusergroup="1"
		default=""
		multiple="0"
		>
		<option value="0">MOD_EXAMPLE_SELECT</option>
	</field>

See also[edit]

User form field type[edit]

Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual User Field instead


The user form field type provides a modal select box of users.

  • type (mandatory) must be user.
  • name (mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.
  • label (mandatory) (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.
  • class (optional) is a CSS class name for the HTML form field.
  • size (optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.

Implemented by: libraries/cms/form/field/user.php

Example user form field definition:

<field name="modified_user_id" type="user"
	label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
	class="readonly"
	readonly="true"
	filter="unset" />

Note![edit]

The user field only works on administration forms and should not be added to front-end forms.

See also[edit]

User form field type/de[edit]

Der Benutzer-Formularfeldtyp unterstützt eine Mofal-Auswahlliste der Benutzer.

  • type (mandatory) must be user.
  • name (mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.
  • label (mandatory) (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.
  • class (optional) is a CSS class name for the HTML form field.
  • size (optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.

Implemented by: libraries/cms/form/field/user.php

Example user form field definition:

<field name="modified_user_id" type="user"
	label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
	class="readonly"
	readonly="true"
	filter="unset" />

Note![edit]

The user field only works on administration forms and should not be added to front-end forms.

See also[edit]

User form field type/en[edit]

The user form field type provides a modal select box of users.

  • type (mandatory) must be user.
  • name (mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.
  • label (mandatory) (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.
  • class (optional) is a CSS class name for the HTML form field.
  • size (optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.

Implemented by: libraries/cms/form/field/user.php

Example user form field definition:

<field name="modified_user_id" type="user"
	label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
	class="readonly"
	readonly="true"
	filter="unset" />

Note![edit]

The user field only works on administration forms and should not be added to front-end forms.

See also[edit]

Usergroup form field type[edit]

Stop hand nuvola.svg.png
Warning!

Since Joomla 4 this field is no longer available. Please see Joomla Manual Usergrouplist Field instead


The usergroup form field type provides a dropdown select box of user groups.

  • type (mandatory) must be usergroup.
  • name (mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.
  • label (mandatory) (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.
  • class (optional) is a CSS class name for the HTML form field.
  • size (optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.
  • multiple (optional) If set to multiple then allows more than one usergroup to be selected.

Implemented by: libraries/joomla/form/fields/usergroup.php

Example usergroup form field definition:

<field name="guest_usergroup" type="usergroup"
	label="COM_USERS_CONFIG_FIELD_GUEST_USER_GROUP_LABEL"
	description="COM_USERS_CONFIG_FIELD_GUEST_USER_GROUP_DESC" 
	multiple="true" />

See also[edit]

Usergroup form field type/de[edit]

Der Benutzergruppe-Formularfeldtyp unterstützt eine Drop-down-Auswahlliste der Benutzergruppen.

  • type (mandatory) must be usergroup.
  • name (mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.
  • label (mandatory) (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.
  • class (optional) is a CSS class name for the HTML form field.
  • size (optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.
  • multiple (optional) If set to multiple then allows more than one usergroup to be selected.

Implemented by: libraries/joomla/form/fields/usergroup.php

Example usergroup form field definition:

<field name="guest_usergroup" type="usergroup"
	label="COM_USERS_CONFIG_FIELD_GUEST_USER_GROUP_LABEL"
	description="COM_USERS_CONFIG_FIELD_GUEST_USER_GROUP_DESC" 
	multiple="true" />

See also[edit]

Usergroup form field type/en[edit]

The usergroup form field type provides a dropdown select box of user groups.

  • type (mandatory) must be usergroup.
  • name (mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.
  • label (mandatory) (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.
  • class (optional) is a CSS class name for the HTML form field.
  • size (optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.
  • multiple (optional) If set to multiple then allows more than one usergroup to be selected.

Implemented by: libraries/joomla/form/fields/usergroup.php

Example usergroup form field definition:

<field name="guest_usergroup" type="usergroup"
	label="COM_USERS_CONFIG_FIELD_GUEST_USER_GROUP_LABEL"
	description="COM_USERS_CONFIG_FIELD_GUEST_USER_GROUP_DESC" 
	multiple="true" />

See also[edit]