Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamically drawn radio buttons not working in MSIE

 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Spoke too soon.
Firefox (rightly) doesn't like:
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is how I do it:

http://pascarello.com/examples/createElement.html

Eric
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep that method shaves off milliseconds!

Eric
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic