CD-511Appendix F . Examples from Parts III and IV Notice two other important changes. First, the SELECT element now contains a blank first option. When a user visits the page, nothing is selected yet, so you should present a blank option to encourage the user to make a selection. The function also makes sure that the user selects one of the color-valued items before it attempts to change the background color. Second, the BODY element contains an onUnload event handler that resets the form. The purpose behind this is that if the user navigates to another page and uses the Back button to return to the page, the script-adjusted background color does not persist. I recommend you return the SELECT element to its original setting. Unfortunately, the reset does not stick to the form in IE4 and IE5 for Windows (although this problem appears to be repaired in IE5.5). Another way to approach this issue is to use the onLoadevent handler to invoke seeColor(), passing as a parameter a reference to the SELECT element. Thus, if the SELECT element choice persists, the background color is adjusted accordingly after the page loads. Listing 26-8: Triggering a Color Change from a Pop-Up Menu
Color Changer 2 SELECT.onChange
We recommend cheap and reliable webhost to host and run your web applications:
Coldfusion Web Hosting services.