HTML_QuickForm_advmultiselect : The Definitive Guide |
HTML_QuickForm_advmultiselect::setButtonAttributes
- Sets the button attributes
require_once 'HTML/QuickForm/advmultiselect.php';
void HTML_QuickForm_advmultiselect::setButtonAttributes(
|
$button, | |
$attributes = NULL) ;
|
string | $button; |
mixed | $attributes = NULL; |
The basic settings gave standard form input buttons. You may change
the look with some CSS if you set the class attribute in the $attributes
hash (second parameter).
See example section.
Only five attributes may be set, they are:
name
The form input button name. Default are: 'add', or 'remove', or, 'all', or 'none', or 'toggle', or 'up', or 'down'.
value
The form input button text. Default are ' >> ', or ' << ', or ' Select All ', or ' Select None ', or ' Toggle Selection ', or ' Up ', or ' Down '.
type
The form input button kind. Default is 'button' (Can be either 'button' or 'image').
class
A CSS class identifier in one of your stylesheets.
src
URL of the image file used.
$button
Button identifier, either 'add', 'remove', 'all', 'none', 'toggle', 'moveup' or 'movedown'
$attributes
(optional) Either a typical HTML attribute string or an associative array
Table 8.1. Possible PEAR_Error values
Error message | Reason | Solution |
---|---|---|
Argument 1 of advmultiselect::setButtonAttributes is not a string | Tried to give a button identifier of unknown type | Check the $button argument data type |
Argument 1 of advmultiselect::setButtonAttributes has unexpected value | Tried to give a button identifier of unknown value | Check the $button argument data range |
In this example, the 'add' and 'remove' buttons have look set by the css class 'inputCommand'.
You may also use images rather than standard form input button. Replaces lines :
by lines that should like :
HTML_QuickForm_advmultiselect : The Definitive Guide | v 1.4.0 : 9 Juin 2007 |