Yay my first post!
Firefox 3 and IE8 are giving me different values for an onchange event attached to a form select box. All I'm trying to do is detect when a user chooses an item in a select box. If he choses the empty item I want my "Next" button disabled. If he choses a valid name, then I want the "Next" button enabled. Here's the relevant code.
And the associated HTMLCode:<script type="text/javascript"> function toggleButton() { if ((document.getElementsByName("T1")[0].value == "") && (document.getElementsByName("T2")[0].value == "")) {document.getElementsByName("nextBtn")[0].disabled = true;} else {document.getElementsByName("nextBtn")[0].disabled = false;} } </script>
When toggleButton() fires after an onchange event the two .value calls return the current correct values. When I do this in IE8, the .value calls are always empty (I assume "").HTML Code:<select name="T1" onChange="toggleButton()"><option></option><option>Mrs Amber</option></select
Can someone fill me in on what IE8's doing and how I can resolve this? (And if you happen to see any general coding improvements, this ex Smalltalk/newbie Javascript developer would welcome them.)
Thank you in advance.


)
Reply With Quote

Bookmarks