Skip navigation

Category Archives: Js

When doing validation, try to use getElementById instead of using the DOM hierarchy to access form items. Firefox and IE responded well to input form items but not drop down menu’s. For example: firefox will pick up document.myForm.dropdown.selectedIndex but IE won’t. Solution? Use getElementById(“dropdown”).selectedIndex

<form name=”myForm”>

<select id=”dropdown” name=”dob” type=”list”>

<option>01</option>
<option>02</option>

</select>

</form>