Tue, 19 Sep 2006
Damn IE JS event behaviour
I've wrote some application in Rails, using prototype/scriptaculous javascript library. It works great in FF, but in IE it has some fails...

I've had following code:

<%= check_box "adsl_cpe_chk", "yes", {:onChange => "if (this.checked) { Element.show('adsl_cpe');} else { Element.hide('adsl_cpe');}"}%>
  <select name="adsl[cpe]" id="adsl_cpe" style="display:none">
    <%= options_from_collection_for_select @data_devices, :code, :name%>
  </select>
and if I clicked (set) checkbox, the select field was still hidden - until I clicked somewhere else - with IE only. I've discovered, if I replace onChange with onClick, it works ok. A few hours of trying everything are gone :(


(posted at 13:40 | filed under programming | link)    (comments | add new)