Click or drag to resize

addOption Method

Adds a new PdfOption Class representing an option for this ComboField or ListField.

Syntax
JavaScript
function addOption(name, exportValue, selected);

Parameters

name

Type: String

The name of the new option to be added.

exportValue

Type: String

The export value of the new option to be added.

exportValue

Type: Boolean

A boolean value indicating whether this new option should be selected.

Return Value

Type: PdfOption Class

Returns a new PdfOption Class instance if the operation completed successfully; otherwise, null.

Remarks

The name parameter must be a unique value for this object. The name parameter must not be an empty string or null.

This method must only be called on objects where the getType Method is a ComboField or ListField.

This method can not be called on objects where isLocked Method is true. unlock Method must be called first.

The new PdfOption Class is added to the end of the collection for this PdfObject Class.

See Also