Database List (DBList)

Function : Creates a <select> list whose elements are read from a database table

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
Table name Name of the table from which the list will be populated "#__" prefixes are allowed
Key field The name table field whose values will be used as the “value” attribute for the “option” tag , i.e. The value that will be stored in the Database
Value field The name table field whose values will be used as the “text” for the “option” tag , i.e. The text that will be shown to the user
Order field The name table field that is used for ordering
Order Mode The ordering mode “Ascending or descending

Example

To create a list box containing all usernames indexed by id , sorted by id in ascending manner you will

  • Set Table name = ”# __users”
  • Set Key field = “id”
  • Set Value field = “username”
  • Set Order field = “id”
  • Set Order mode = “Ascending”
 
0.7/elements/dblist.txt · Last modified: 2009/09/06 17:24 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