SetFormFieldRangeValidation

Form fields, actions

Description

Adds an AFRange_Validate action with independently enabled minimum and maximum bounds

Syntax

Function TPDFlib.SetFormFieldRangeValidation(Index: Integer; HasMinimum: Boolean; Minimum: Double; HasMaximum: Boolean; Maximum: Double): Integer;

Parameters

IndexOne-based form-field index that receives the validation action
HasMinimumTrue to enforce Minimum, so a bound of zero stays usable
MinimumLower bound; it must be finite and is emitted with a locale-independent decimal point
HasMaximumTrue to enforce Maximum
MaximumUpper bound; it must be finite and must not be below Minimum when both bounds are enabled

Return values

1The AFRange_Validate action was added to the field
0Both bounds are disabled, a bound is NaN or infinite, Minimum exceeds Maximum, the field index is invalid, or the action cannot be stored

Remarks

Use the Boolean flags to enable bounds, so zero remains a valid minimum or maximum

Numbers are emitted with a locale-independent decimal point and NaN, infinity, disabled-both and reversed ranges are rejected

See also

SetFormFieldNumberFormat