Web and email hosting - CD-164 Part VI . Appendixes (named lab) contains

CD-164 Part VI . Appendixes (named lab) contains four elements. Scripts invoked by buttons in the lower form control the tabbing sequence. Notice that the TABINDEX attributes of all lower form elements are set to -1, which means that these control buttons are not part of the tabbing sequence in IE. When you load the page, the default tabbing order for the labform control elements (default setting of zero) takes charge. If you start pressing the Tab key, the precise results at first depend on the browser you use. In IE, the Address field is first selected; next the Tab sequence gives focus to the window (or frame, if this page were in a frameset); finally the tabbing reaches the labform. Continue pressing the Tab key and watch how the browser assigns focus to each of the element types. In NN6, however, you must click anywhere on the content to get the Tab key to start working on form controls. The sample script inverts the tabbing sequence with the help of a for loop that initializes two variables that work in opposite directions as the looping progresses. This gives the last element the lowest tabIndexvalue. The skip2() function simply sets the tabIndex property of the second text box to -1, removing it from the tabbing entirely (IE only). Notice, however, that you can click in the field and still enter text. (See the disabled property earlier in this chapter to see how to prevent field editing.) NN6 does not provide a tabIndexproperty setting that forces the browser to skip over a form control. You should disable the control instead. Listing 15-16: Controlling the tabIndex Property tabIndex Property