ExecuteFormFieldScriptWithRepliesJSON
表單欄位與 JavaScript
描述
執行 AcroForm 欄位事件指令碼,並從 JSON 重播確定性的 app.alert 與 app.response 主機回覆
語法
Delphi
Function TPDFlib.ExecuteFormFieldScriptWithRepliesJSON(Index, Action: Integer; Const Value, Change: WideString; SelStart, SelEnd, Flags: Integer; Const RepliesJSON: WideString): WideString;
參數
| Index | 表單欄位索引(1 起算) |
|---|---|
| Action | 事件選擇器:0 驗證、1 計算、2 格式、3 按鍵 |
| 值 | 提供給 event.value |
| Change | 提供給 event.change 的插入或替代文字(用於按鍵事件) |
| SelStart, SelEnd | 按鍵事件前的選取範圍(0 起算) |
| Flags | 位元遮罩,可合併 1 willCommit、2 fieldFull、4 keyDown、8 modifier與 16 shift |
| RepliesJSON | JSON 陣列或物件,內含 app.alert 按鈕代碼與 app.response 字串或 null |
傳回值
回傳 JSON 物件,回報執行狀態、最終 value, change, rc、選取範圍與已消費的主機對話方塊提示。
備註
依請求順序,把每個指令碼化的 app.alert 或 app.response 呼叫與 RepliesJSON 中的下一項比對,且不顯示 UI 對話方塊。
若必要回覆缺失、不符或未被消費,則暫緩對文件欄位的變更。
另請參閱
ExecuteFormFieldScriptJSON, SetFormScriptHostActionMode, GetFormScriptDiagnostics