596 Part III . Document Objects Reference Figure (Web design conference)

596 Part III . Document Objects Reference Figure 26-1: Radio button choices alter the contents of the SELECT object on the fly. In the second pair of radio buttons, each button stores a value indicating how many items should be displayed when the user clicks the button. This number is picked up by the setCount()function and is used in the repeat loop as a maximum counting point. In the meantime, the function finds the selected language radio button and zeros out the SELECT object entirely. Options are rebuilt from scratch using the new Option()constructor for each option. The parameters are the corresponding display text entries from the arrays. Because none of these new options have other properties set (such as which one should be selected by default), the function sets that property of the first item in the list. Notice that both functions call history.go(0) for NN3 and NN4 browsers after setting up their SELECT objects. The purpose of this call is to give these earlier Navigator versions an opportunity to resize the SELECT object to accommodate the contents of the list. The difference in size here is especially noticeable when you switch from the six-color, plain-language list to any other list. Without resizing, some long items are not readable. IE4+ and NN6, on the other hand, automatically redraw the page to the newly sized form element. Modifying SELECT options (IE4+) Microsoft offers another way to modify SELECT element options for IE4+, but the technique involves two proprietary methods of the optionsarray property of the SELECT object. Because I cover all other ways of modifying the SELECT element in this section, I cover the IE way of doing things here as well. SELECT
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.

Leave a Reply