Actions

Difference between revisions of "Usergroup form field type"

From Joomla! Documentation

(Created page with "{{stub}} The '''usergroup''' form field type provides a modal select box of user groups. * '''type''' (mandatory) must be ''usergroup''. * '''name''' (mandatory) is the uniq...")
 
m (removed Category:Form fields using HotCat)
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{stub}}
 
 
The '''usergroup''' form field type provides a modal select box of user groups.
 
The '''usergroup''' form field type provides a modal select box of user groups.
  
 
* '''type''' (mandatory) must be ''usergroup''.
 
* '''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.
 
* '''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.
 
* '''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.
 
* '''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.
 
* '''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.
 
* '''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/joomla/form/fields/usergroup.php
  
 
Example user form field definition:
 
Example user form field definition:
    <field name="title" type="usergroup" label="Select a user group" />
+
<source type="php">
 +
<field name="guest_usergroup" type="usergroup"
 +
label="COM_USERS_CONFIG_FIELD_GUEST_USER_GROUP_LABEL"
 +
description="COM_USERS_CONFIG_FIELD_GUEST_USER_GROUP_DESC">
 +
default="1" />
 +
</source>
  
 
<noinclude>
 
<noinclude>
 
=== See also ===
 
=== See also ===
 
* [[Standard form field types|List of standard form field types]]
 
* [[Standard form field types|List of standard form field types]]
[[Category:Standard form field types]]</noinclude>
+
[[Category:Standard form field types]] </noinclude>

Revision as of 09:18, 21 September 2013

The usergroup form field type provides a modal 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.

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

Example user 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">
        default="1" />


See also