ExecuteFormFieldScriptJSON

Formulaires, sécurité JavaScript

Description

Exécute une action de validation, de calcul, de formatage ou de frappe d’un champ et renvoie le résultat et l’état de l’événement en JSON. Elle fournit ExecuteFormFieldScriptEvent aux interfaces DLL et ActiveX

Syntaxe

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

Disponible sur IPDFlibrary4 à partir de la version 3.5 de la bibliothèque de types

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);

Paramètres

IndexL’indice de champ à partir de 1
Action0 validate, 1 calculate, 2 format ou 3 keystroke
Value, ChangeLes event.value et event.change initiaux
SelStart, SelEndLa sélection que le changement remplace
FlagsSomme de 1 willCommit, 2 fieldFull, 4 keyDown, 8 modifier et 16 shift

Valeurs de retour

Un objet JSON avec result (la valeur de retour d’ExecuteFormFieldScriptEvent), value, change, rc, selStart et selEnd ; un Action invalide renvoie {"result":0} avec LastErrorCode 708

Le champ source est le champ cible. Les chaînes DLL appartiennent au tampon de retour de l’instance et doivent être copiées avant l’appel suivant

Voir aussi

ExecuteFormFieldScriptEvent, SetFormScriptHostActionMode, GetFormScriptDiagnostics