ExecuteFormFieldScriptJSONA

表單、JavaScript 安全性

描述

結尾的 A 表示 ANSI(char)DLL 進入點;ActiveX/COM 介面只提供 Unicode 形式。行為與 ExecuteFormFieldScriptJSON 完全相同,字串參數依目前 SetAnsiMode 的字碼頁解讀

執行欄位的驗證、計算、格式化或按鍵動作,並以 JSON 傳回結果與事件狀態。它為 DLL 與 ActiveX 介面提供 ExecuteFormFieldScriptEvent

語法

Delphi

Function DLExecuteFormFieldScriptJSONA(InstanceID, Index, Action: Integer; Value, Change: PAnsiChar; SelStart, SelEnd, Flags: Integer): PAnsiChar;

DLL

const char* DLExecuteFormFieldScriptJSONA(int InstanceID, int Index, int Action, const char* Value, const char* Change, int SelStart, int SelEnd, int Flags);

參數

Index以 1 為基準的欄位索引
Action0 驗證、1 計算、2 格式化或 3 按鍵
Value, Change初始 event.value 與 event.change
SelStart, SelEnd該變更取代的選取範圍
Flags1 willCommit、2 fieldFull、4 keyDown、8 modifier 與 16 shift 的總和

傳回值

JSON 物件,含 result(ExecuteFormFieldScriptEvent 的傳回值)、value、change、rc、selStart 與 selEnd;無效的 Action 傳回 {"result":0} 並帶 LastErrorCode 708

來源欄位即目標欄位。DLL 字串屬於執行個體傳回緩衝區,必須在下一次呼叫前複製

另請參閱

ExecuteFormFieldScriptEvent, SetFormScriptHostActionMode, GetFormScriptDiagnostics