PEAR Manual
Prev |  | Next

# HTML_QuickForm_hierselect::setSecOptions()

HTML_QuickForm_hierselect::setSecOptions() -- Sets the options for the secondary select

## Synopsis

    require_once 'HTML/QuickForm/hierselect.php';

``void HTML_QuickForm_hierselect::setSecOptions` (array $options)`

## Description

Sets the options for the secondary select. Options are passed as a two-dimensional array, where the first key is parent id and the second key is child id, as it is needed to know the parent option to which the secondary option relates.

## Parameter

array `$options`

  Array of options for the second select

## Throws

throws no exceptions thrown

## See

see setMainOptions().

## Note

This function can not be called statically.

## Example

Example 41-1. Setting the hierselect options
    <?php
    $hierSel =& $form->addElement('hierselect', 'test', 'Test:', null, '/');

    $main[0] = 'Pop';
    $main[1] = 'Classical';
    $main[2] = 'Funeral doom';

    $sec[0][1] = 'Red Hot Chili Peppers';
    $sec[0][2] = 'The Pixies';
    $sec[1][3] = 'Wagner';
    $sec[1][4] = 'Strauss';
    $sec[2][5] = 'Pantheist';
    $sec[2][6] = 'Skepticism';

    $hierSel->setMainOptions($main);
    $hierSel->setSecOptions($sec);
    ?>

Prev | Home | Next
HTML_QuickForm_hierselect::setMainOptions() | Up | Class Summary HTML_QuickForm_html