Manuals

 

SetaPDF_ChoiceField::setValue()

Description

class SetaPDF_ChoiceField extends SetaPDF_FormField {
mixed setValue ( mixed $value ) }

Sets the new selected option or options of the choice field.

Parameters

$value

To select a single option just pass the zerobased index returned from SetaPDF_ChoiceField::getOptions() to this method. In case to select multiple options (if allowed) pass an array with the zerobased indexes as values to this method.

A choice field allows different values depending on it's own definition:

If the choice field is defined as a combo box, it just can hold one value.

If it is defined as a list box and multiselect is set it can hold multiple values.

A special case is a choice field which offers an editable text box. In this case the value haven't to be an index of the option list but can be any text like a text field.

Return Value

True, if everythings works as expected. A SetaPDF_Error object if an error occurs.