タブ順序からのオブジェクトの除外

この例は、デフォルトのタブ順序からオブジェクトを除外する方法を示しています。この例では、ユーザーは TextField1 から開始し、Tab キーを使用して TextField2、TextField3 の順に移動します。ただし、コンボボックスオブジェクト DropDownList1 は、ユーザーがカーソルを TextField2 に置いた場合に表示するように設定されます。

この場合、デフォルトのタブ順序は次のようになります。

タブ順序から DropDownList1 を除外するには、TextField2 オブジェクトに次のスクリプトを追加します。

イベント

スクリプト

enter

// This conditional statement displays DropDownList3 to the user // and sets the focus of the client application to TextField2. if (DropDownList3.presence != "visible") { DropDownList3.presence = "visible"; xfa.host.setFocus(this); }

exit

// This conditional statement tests to see if the user is // pressing the Shift key while pressing the Tab key. If Shift is // held down, then the client application focus returns to // TextField1, otherwise the focus is set to TextField3. The // experience for the user is that DropDownList3 is not a // part of the tabbing order. var isShiftDown = xfa.event.shift; if (isShiftDown) { xfa.host.setFocus(TextField1); } else { xfa.host.setFocus(textField3); }