List element

Function : Creates a list ”<select> list”

Parameters

Label The label of this element
CSS Class CSS class assigned to this element
Style using CSS only Defines whether or not JForms should append inline CSS attributes to the element, Set to “YES” if you want to disable inline CSS attributes
Multi-Select Whether or not to allow the user to select more than one element
Required Whether or not this field is required , the Form will not be submitted until this field is filled
Options Elements of this list, each element should be in a separate line
Common List Which pre-defined list to use, Pick manual to specify options yourself, also see ”Adding a pre-defined list

Note about “Required” parameter : this parameter behaves differently based on the value of the “Multi-Select” parameter

  • If “Multi-Select” is set to “Yes” and “Required” is set to “Yes”, This element will only pass validation if the user selects at least one option.
  • If “Multi-Select” is set to “No” and “Required” is set to “Yes”, This element will only pass validation if the user picks any option other than the first one.

Examples

Example 1

To create a required list box containing 5 options allowing one option selection

  • Set “Required” = “Yes”
  • Set “Options”
=== Please Select ===
Option 1
Option 2
Option 3
Option 4
Option 5
  • Set “Multi-Select” = “No”
Example 2

To create a list box containing world countries

  • Set Common List = “Countries”
 
0.7/elements/list.txt · Last modified: 2009/09/06 18:35 by dr_drsh
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki