void setOptions(
array
$options)
|
|
Initialize the array structure containing the options for each select element.
Call the functions that actually do the magic.
Format is a bit more complex than for a simple select as we need to know which options are related to the ones in the previous select:
Ex: // first select
$select1[0] = 'Pop';
$select1[1] = 'Classical';
$select1[2] = 'Funeral doom';
// second select
$select2[0][0] = 'Red Hot Chil Peppers';
$select2[0][1] = 'The Pixies';
$select2[1][0] = 'Wagner';
$select2[1][1] = 'Strauss';
$select2[2][0] = 'Pantheist';
$select2[2][1] = 'Skepticism';
// If only need two selects
// - and using the deprecated functions
$sel =& $form->addElement('hierselect', 'cds', 'Choose CD:');
// - and using the new setOptions function
$sel =& $form->addElement('hierselect', 'cds', 'Choose CD:');
// If you have a third select with prices for the cds
$select3[0][0][0] = '15.00$';
$select3[0][0][1] = '17.00$';
// etc
// You can now use
$sel =& $form->addElement('hierselect', 'cds', 'Choose CD:');
$sel->setOptions(array
($select1, $select2, $select3));
Parameters:
void setSecOptions(
array
$array)
|
|
Sets the options for the second select element. Deprecated. setOptions() should be used.
The main _options array is initialized and the _setOptions function is called.
Parameters: