593Chapter 26 .Select, Option, and FileUpload (Free web servers) Objects .

593Chapter 26 .Select, Option, and FileUpload Objects . Text to be displayed in the option . Contents of the option s value property . Whether the item is the defaultSelected option (Boolean) . Whether the item is selected (Boolean) You can set any (or none) of these items as part of the constructor and return to other statements to set their properties. I suggest setting the first two parameters (leave the others blank) and then setting the selectedproperty separately. The following is an example of a statement that creates a new, fifth entry in a SELECT object and sets both its displayed text and valueproperties: selectObj.options[4] = new Option( Yahoo , http://www.yahoo.com ) To demonstrate all of these techniques, Listing 26-1 enables you to change the text of a SELECT object first by adjusting the text properties in the same number of options and then by creating an entirely new set of options. Radio button onClick event handlers trigger functions for making these changes rare examples of when radio buttons can logically initiate visible action. Listing 26-1: Modifying SELECT Options Changing Options On The Fly