Sunday, 15 May 2011

html - Why does IE9 not display javascript element properly unless "developer tools" is opened? -


I am working with a form that will display a SelectField (id = 'database') and only if the checkbox ( Id = 'optional') is selected (using Javascript) SelectField (id = 'alt_databases') will be displayed. This code works perfectly for Chrome / Firefox, but when I open "Developer Tools" then only works in IE9 based on Code Flask, Genza 2, and Javascript. Does anyone have advice on this? I am certain that this is an IE specific problem.

Form:

  & lt; Form method = 'post' & gt; {{Form.hidden_tag ()}} {{form.alternate.label}} & lt; Br> {{Form.alternate}} & lt; Table class = 'center' style = 'margin-left: automatic; Margin-right: auto, width: 70% '& gt; & Lt; TR & gt; & Lt; Td square = 'media-left' style = 'display: none;' & Gt; {{Form.alt_databases.label}} & lt; Br> {{Form.alt_databases (size = 20)}} & lt; Br> & Lt; / TD & gt; & Lt; Td square = 'media-right' & gt; {{Form.databases.label}} & lt; Br> {{Form.databases (size = 20)}} & lt; Br> & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt; & Lt; Br> & Lt; P & gt; {{Form.submit}} & lt; / P & gt; & Lt; / Form & gt; Javascript:  
  (function () {var el = document.getElementById ('optional'), source = document.getElementById ('alt_databases') ; Target = document.getElementById ('database'); el.addEventListener ('change', function () (if (L. check) {source.parentNode.style.display = 'block';} else {source.parentNode Style.display = 'none';}});}) ();  


No comments:

Post a Comment