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
| Index | One-based form-field index that receives the validation action |
|---|---|
| HasMinimum | True to enforce Minimum, so a bound of zero stays usable |
| Minimum | Lower bound; it must be finite and is emitted with a locale-independent decimal point |
| HasMaximum | True to enforce Maximum |
| Maximum | Upper bound; it must be finite and must not be below Minimum when both bounds are enabled |
Return values
| 1 | The AFRange_Validate action was added to the field |
|---|---|
| 0 | Both 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