ExecuteFormFieldTriggerScript
Forms, JavaScript safety
Description
Runs one of a field's non-value JavaScript actions
Syntax
Delphi
Function TPDFlib.ExecuteFormFieldTriggerScript(Index: Integer; Const Trigger: WideString): Integer;
ActiveX
Function PDFlib::ExecuteFormFieldTriggerScript(Index As Long, Trigger As String) As Long
Available on IPDFlibrary4 from type library version 3.5
DLL
int DLExecuteFormFieldTriggerScript(int InstanceID, int Index, const wchar_t* Trigger);
int DLExecuteFormFieldTriggerScriptA(int InstanceID, int Index, const char* Trigger);
Parameters
| Index | The one-based field index |
|---|---|
| Trigger | Fo focus, Bl blur, D mouse down, U mouse up, E mouse enter, X mouse exit, PO, PC, PV or PI page open, close, visible or invisible |
Return values
Returns 1 when the script ran, or 0 when the action is absent (diagnostics report notRun with reason missingAction), the trigger or target is invalid (LastErrorCode 708, or a missing form or field), or the script is unsupported, invalid or over budget (706, 708, 709)
Remarks
event.type is Field and event.name is Focus, Blur, Mouse Down, Mouse Up, Mouse Enter, Mouse Exit, Page Open, Page Close, Page Visible or Page Invisible. event.target is the field and event.value its current value
The script runs in the bounded form-script runtime with the configured limits and host action mode. event.type and event.name identify the event, and event.rc is not used. Field values the script assigns, such as getField("Total").value = ..., are written to the document
Host actions such as app.alert are never performed; see SetFormScriptHostActionMode
Value events (K, F, V and C) use ExecuteFormFieldScriptEvent
See also
ExecuteFormFieldScriptEvent, SetFormScriptHostActionMode, GetFormScriptDiagnostics