Documentation Menu

1.5 Template Project

The Joomla! Documentation Working Group is running a project to develop detailed reference and tutorial material on Joomla! 1.5 templates.  There is a project page on the documentation wiki where you can see the work in progress and help us by contributing your knowledge.

Who's Online

We have 18 guests online

Help Site License

The Joomla! Help Site content is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution NonCommercial ShareAlike 2.5. Some parts of this website may be subject to other licenses.
Home arrow Manual arrow 11. API Reference arrow mosHTML::yesnoRadioList

mosHTML::yesnoRadioList PDF Print E-mail

Last reviewed: Not reviewed
phpDocumentor

mosHTML::yesnoRadioList

A convenient method of building an HTML radio list consisting of just a 'yes' button and a 'no' button. The words for 'yes' and 'no' are taken from the current language settings.  The HTML field will return a '0' is the user selects 'no' or '1' if the user selects 'yes'.

Syntax

string yesnoRadioList ( string $tag_name, string $tag_attribs, mixed $selected [, string $yes [, string $no ]] )

$tag_name
is the name attribute of the HTML radio button field.
$tag_attribs
is a string containing any additional attributes that you want to assign to each HTML radio button field.
$selected
is a string containing the value of the radio button that will be selected by default.  This will be '0' for 'no' or '1' for 'yes'.
$yes
is a string containing the word for 'Yes' that will be displayed to the user. This parameter is optional and if omitted will default to the word for 'Yes' taken from the current language settings.
$no
is a string containing the word for 'No' that will be displayed to the user. This parameter is optional and if omitted will default to the word for 'No' taken from the current language settings.

Examples

Example 1: A simple yes/no radio button field with 'No' selected by default.

// A simple yes/no radio button field.
$html = mosHTML::yesnoRadioList( 'myswitch', 'class="inputbox"', '0' );
echo $html;

which produces:

<input type="radio" name="myswitch" value="0" checked="checked" class="inputbox" />No
<input type="radio" name="myswitch" value="1" class="inputbox" />Yes
 

which renders as:
No Yes

Example 2: A radio button field for 'On' or 'Off' selection with 'On' selected by default.

// An on/off radio button field.
$html = mosHTML::yesnoRadioList( 'myswitch', 'class="inputbox"', '1', 'On', 'Off' );
echo $html;

which produces:

<input type="radio" name="myswitch" value="0" class="inputbox" />Off
<input type="radio" name="myswitch" value="1" checked="checked" class="inputbox" />On
 

which renders as:
Off On


Please report any errors on this page to the Developer Documentation Forum.

Last Updated ( Saturday, 03 September 2005 )
 
< Prev   Next >