Update to "Select Boxes with Style"

by Castwide on 4-9-2008 • Tags: css, ie, javascript, select, style10 comments

A visitor commented under the article "Select Boxes with Style" that the solution did not work in Internet Explorer 6. Today I revised the JavaScript code so it works the same in IE 6, IE 7, and Firefox 2.

The problem was with the onclick event that called the function to highlight the appropriate selections.  The function was called from the input (radio or checkbox) onclick events.  IE 6 ignored the event, apparently because the inputs were not visible.

The solution was to add some extra code for IE so a click event on a label would call the appropriate input's click() function, thereby triggering the function to highlight the selected options.

Due to the above, it was also possible to remove a different block of IE-only code that used an alternative method of hiding the inputs.  Now all browsers can simply use display: none.

The updated code is available in the original article.  Thanks to the reader who mentioned the problem.

Comments

auto insurance quotes 8-DD health insurance ctquer
car insurance quotes xtlz auto insurance rates %OOO
eastwood auto insurance ozby life insurance 218
car insurance rates =-((( life insurance 633
insurance home zagu car insurance online 494
tramadol 384420 order viagra niemn
ultram cucy viagra =-[[
home insurance florida 82334 free health insurance 849
purchase cialis on the internet %DD ultram tseoe
viagra 3271 headache ultram nnluyd

Add Comment

More Articles