ExecuteFormFieldScriptJSON
Formulare, JavaScript-Sicherheit
Beschreibung
Führt eine Feld-Validierung, -Berechnung, -Formatierung oder Keystroke-Action aus und liefert Ergebnis und Ereigniszustand als JSON — das ExecuteFormFieldScriptEvent für die DLL- und ActiveX-Schnittstellen
Syntax
Delphi
Function TPDFlib.ExecuteFormFieldScriptJSON(Index, Action: Integer; Const Value, Change: WideString; SelStart, SelEnd, Flags: Integer): WideString;
ActiveX
Function PDFlib::ExecuteFormFieldScriptJSON(Index As Long, Action As Long, InputValue As String, Change As String, SelStart As Long, SelEnd As Long, Flags As Long) As String
Verfügbar auf IPDFlibrary4 ab Typbibliotheksversion 3.5
DLL
const wchar_t* DLExecuteFormFieldScriptJSON(int InstanceID, int Index, int Action, const wchar_t* Value, const wchar_t* Change, int SelStart, int SelEnd, int Flags);
const char* DLExecuteFormFieldScriptJSONA(int InstanceID, int Index, int Action, const char* Value, const char* Change, int SelStart, int SelEnd, int Flags);
Parameter
| Index | Der 1-basierte Feldindex |
|---|---|
| Action | 0 validate, 1 calculate, 2 format oder 3 keystroke |
| Value, Change | Das anfängliche event.value und event.change |
| SelStart, SelEnd | Die Auswahl, die die Änderung ersetzt |
| Flags | Summe aus 1 willCommit, 2 fieldFull, 4 keyDown, 8 modifier und 16 shift |
Rückgabewerte
Ein JSON-Objekt mit result (Rückgabewert von ExecuteFormFieldScriptEvent), value, change, rc, selStart und selEnd; eine ungültige Action liefert {"result":0} mit LastErrorCode 708
Das Quellfeld ist das Zielfeld. DLL-Strings liegen im Rückgabe-Puffer der Instanz und müssen vor dem nächsten Aufruf kopiert werden
Siehe auch
ExecuteFormFieldScriptEvent, SetFormScriptHostActionMode, GetFormScriptDiagnostics