THotPDF.GetLoadedFormFieldOption Method
Reads the export value of the specified option in the loaded PDF form field, whilst returning the corresponding display text via an output parameter
Declaration
function GetLoadedFormFieldOption(FieldIndex, OptionIndex: Integer; out ADisplayValue: AnsiString): AnsiString;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
FieldIndex | The zero-based index of the target form field |
OptionIndex | The zero-based option index within the field's options list |
ADisplayValue | Output parameter, receives the text displayed to the user for this option on the interface |
ADisplayText | Input supplied to GetLoadedFormFieldOption |
Return value
Returns the export value of this option, which is the actual string passed to the server or FDF when the form is submitted
Usage notes
- Only applies to field types with an option list (a ComboBox or ListBox, for example); calling it on a plain text field returns an empty string
- OptionIndex must lie between 0 and GetLoadedFormFieldOptionCount - 1
- Export values and display text can differ; please distinguish between their uses before submission to avoid mistaking display text for submitted content