<font face="arial" size="2"> Why would you want it to die just because the browser isn't up to date, when there are perfectly valid methods for finding the control through the form object?<br /><br />Peter<br /><br /></font>
                <font face="Tahoma, Arial, Sans-Serif" size="2">
                                <b>From</b>: Paul Novitski <a href="mailto:paul@juniperwebcraft.com">paul@juniperwebcraft.com</a><br /></font>
                <br />>At 10:21 AM 8/2/2006, Schalk wrote:<br />>>Should the following be able to set the selectedIndex of a select drop down?<br />>><br />>>document.checkout.billingstate.options[document.checkout.billingstate.selectedIndex].value <br />>>= state;<br /><br />At 10:30 AM 8/2/2006, Paul Novitski wrote:<br /><br />>No, that statement sets the value of the option at the selected <br />>location. I believe what you want is:<br />><br />> document.checkout.billingstate.selectedIndex = state;<br />><br />>where 'state' is an integer 0-N.<br /><br /><br />I prefer to code this as:<br /><br /><select id="billingstate" name="billingstate"> ... // exit silently if it's not a DOM-enabled user agent if (!document.getElementById) return; // find the SELECT list var oList = document.getElementById("billingstate"); // might as well abort if the markup's wrong if (!oList) return alert("Fatal HTML error: billingstate not found"); oList.selectedIndex = state;This uses DOM methods and lets the program exit gracefully instead of simply crashing if everything isn't as it should be.Paul _______________________________________________Javascript mailing listJavascript@LaTech.eduhttps://lists.LaTech.edu/mailman/listinfo/javascript</select>