Difference between revisions of "User form field type"

From Joomla! Documentation

(S:MyLanguage/ missing)
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{stub}}
+
<noinclude><languages /></noinclude>
The '''user''' form field type provides a modal select box of users.
+
<translate><!--T:1-->
 +
The '''user''' form field type provides a modal select box of users.</translate>
  
* '''type''' (mandatory) must be ''user''.
+
<translate><!--T:2-->
* '''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.
+
* '''type''' (mandatory) must be ''user''.</translate>
* '''label''' (mandatory) (translatable) is the descriptive title of the field.
+
<translate><!--T:3-->
* '''description''' (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
+
* '''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</translate>.
 +
<translate><!--T:4-->
 +
* '''label''' (mandatory) (translatable) is the descriptive title of the field.</translate>
 +
<translate><!--T:5-->
 +
* '''description''' (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.</translate>
 +
<translate><!--T:6-->
 +
* '''class''' (optional) is a CSS class name for the HTML form field.</translate>
 +
<translate><!--T:7-->
 +
* '''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.</translate>
  
Example XML parameter definition:
+
<translate><!--T:8-->
    <field name="title" type="user" label="Select a user" />
+
Implemented by:</translate> <tt>libraries/cms/form/field/user.php</tt>
 +
 
 +
<translate><!--T:9-->
 +
Example user form field definition:</translate>
 +
 
 +
<source type="php">
 +
<field name="modified_user_id" type="user"
 +
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
 +
class="readonly"
 +
readonly="true"
 +
filter="unset" />
 +
</source>
 +
 
 +
<translate>=== See also === <!--T:10--></translate>
 +
<translate><!--T:11-->
 +
* [[S:MyLanguage/Standard form field types|List of standard form field types]]</translate>
  
 
<noinclude>
 
<noinclude>
=== See also ===
+
<translate>
* [[Standard form field types|List of standard form field types]]
+
<!--T:12-->
[[Category:Standard form field types]]</noinclude>
+
[[Category:Standard form field types]]
 +
</translate>
 +
</noinclude>

Revision as of 08:36, 7 August 2015

Other languages:
Deutsch • ‎English • ‎Nederlands • ‎español • ‎français

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" />

See also[edit]