Actions

J1.5

Difference between revisions of "Radio parameter type"

From Joomla! Documentation

(New page: right The radio parameter type provides radio buttons to select different options. If the parameter has a saved value this is selected when the page is first lo...)
 
(This is a parameter, not a form field.)
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Image:Params.radio.jpg|right]]
 
[[Image:Params.radio.jpg|right]]
The radio parameter type provides radio buttons to select different options.  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.  
+
 
 +
{{Ambox|type=notice|text=[[Parameter|Parameters]] have been superseded by [[Form field|form fields]] in Joomla! 1.6. You may want to use the corresponding [[Radio form field type]].}}
 +
 
 +
The '''radio''' parameter type provides radio buttons to select different options.  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 ''radio''.
 
* '''type''' (mandatory) must be ''radio''.
Line 23: Line 26:
 
=== See also ===
 
=== See also ===
 
* [[List parameter type]]
 
* [[List parameter type]]
* [[Standard parameter types|Full list of standard parameter types]]
+
* [[Standard parameter types|List of standard parameter types]]
</noinclude>
+
[[Category:Standard parameter types]]</noinclude>
[[Category:Templates]]
+

Revision as of 06:55, 21 May 2011

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
Params.radio.jpg

The radio parameter type provides radio buttons to select different options. 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 radio.
  • name (mandatory) is the unique name of the parameter.
  • 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.

The XML <param> 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 parameter definition with </param>.

Example XML parameter definition:

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

See also