ExecuteFormFieldScriptJSON
Formularze, Bezpieczeństwo JavaScript
Opis
Uruchamia akcję walidacji, obliczeń, formatowania albo klawiatury pola i zwraca wynik oraz stan zdarzenia jako JSON. Udostępnia ExecuteFormFieldScriptEvent interfejsom DLL i ActiveX
Składnia
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
Dostępne na IPDFlibrary4 od wersji 3.5 biblioteki typów
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);
Parametry
| Index | Indeks pola liczony od 1 |
|---|---|
| Action | 0 validate, 1 calculate, 2 format albo 3 keystroke |
| Value, Change | Początkowe event.value i event.change |
| SelStart, SelEnd | Zaznaczenie zastępowane zmianą |
| Flags | Suma z 1 willCommit, 2 fieldFull, 4 keyDown, 8 modifier i 16 shift |
Wartości zwracane
Obiekt JSON z result (wartością zwracaną przez ExecuteFormFieldScriptEvent), value, change, rc, selStart i selEnd; niepoprawne Action zwraca {"result":0} z LastErrorCode 708
Polem źródłowym jest pole docelowe. Napisy DLL należą do bufora zwracanego instancji i trzeba je skopiować przed następnym wywołaniem
Zobacz również
ExecuteFormFieldScriptEvent, SetFormScriptHostActionMode, GetFormScriptDiagnostics