WIKINDX METHODS

Method:
selectedBoxValue()

Class:
FORM

Method Call:
include_once("core/html/FORM.php");
STRING FORM::selectedBoxValue(STRING: $label, STRING: $name, ASSOC_ARRAY: $options, STRING: $selected, [INT: $size, INT: $override]);

Description:
Returns a form input element of type select with $options being an associative array whose key equal to $selected is the pre-selected option. $size is 3 by default. If $override is set, this overrides the select box character limit set by the user.

Unlike selectedBox(), this method sets the value parameter of the option tag to the key of the associative array $options.

Usage:
$label is printed a line above the select box. To not print $label, set it to FALSE.

If $options is:

	array(
		"en"	=>	"English",
		"de"	=>	"Deutsch",
		"ts"	=>	"Tsetswana",
		);
then
	$pString = FORM::selectedBoxValue(FALSE, "language", $options, "ts");
would return the string:
	<select name="language" size="3">
	<option  value="en">English</option>
	<option value="de">Deutsch</option>
	<option value="ts" selected>Tsetswana</option>
	</select>

WIKINDX home      WIKINDX usage      WIKINDX classes