| Author |
Dynamically drawn radio buttons not working in MSIE
|
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
By 'not working' I mean that the checked state doesn't change when clicked. This sample is working as expected in FireFox but not MSIE 6 or 7. The Statically drawn ones work fine.
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
Something about asking on a forum makes Google work better. Here is the solution: http://cf-bill.blogspot.com/2006/03/another-ie-gotcha-dynamiclly-created.html
|
 |
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15230
|
|
|
That's strange. I was only able to verify its broke in IE7. I'd be lying if I said I was surprised though. :roll: Sorry, no solution from me at this time.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56204
|
|
Originally posted by Ben Souther: Something about asking on a forum makes Google work better.
And google works better when the words in the article titles are spelled correctly. :roll:
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
Spoke too soon. Firefox (rightly) doesn't like:
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56204
|
|
|
Yup, as with so many other things, you're going to need to branch the code to put up with IE's failings.
|
 |
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15230
|
|
Originally posted by Bear Bibeault: Yup, as with so many other things, you're going to need to branch the code to put up with IE's failings.
Or use a light library that handles it already? I'll try it the JQuery way and let you know...
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
Originally posted by Gregg Bolinger: ...and let you know
Please do. For now, since non-msie browsers throw a proper exception when I use the whole tag as the argument to createElement, I'm using this: It's yucky but it seems to be working. [ October 26, 2007: Message edited by: Ben Souther ]
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
This is how I do it: http://pascarello.com/examples/createElement.html Eric
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
Thanks Eric. I'm going to use your isNameQuirk method. I like that it only does the actual work the first time you call it. As an aside for anyone else following this, there is another issue I found in MSIE. If, you use the same string for the name when creating all of your buttons, and then change the name afterwards, MSIE will still see them as part of the same button group. In FireFox, changing the names after creation will change the button grouping as well.
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
Yep that method shaves off milliseconds! Eric
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
Originally posted by Eric Pascarello: Yep that method shaves off milliseconds!
It's the principle of the thing dammit! Where would we be without principles?
|
 |
 |
|
|
subject: Dynamically drawn radio buttons not working in MSIE
|
|
|