PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

radio button images broken in IE7

  1. I have built a form that uses images for a series of radio button options.
    http://www.alltheotherswerepractice.com/test-shirt-swatches/

    The form is working great in all browsers, except Internet Explorer 7.

    Two things about the images break in IE7:
    - The radio buttons are hidden, and the <img> are not selectable
    - The <img> do not get highlighted when the option is selected

    I unhide the radio buttons, the form logic works as expected.

    To hide the buttons I was using a custom class:

    .hideradio input[type="radio"] {display: none;}

    IE7 gets confused with display:none, so I started using:

    .hideradio input[type="radio"] {position: absolute; left: -9999px;}}

    To highlight the selected option, I am using:

    body #gform_wrapper_43 .gform_body  ul.gfield_radio li input[type="radio"]:checked + label img {
    	background: #eee;
    	border: solid 2pt #c10073;
    }}

    It all works as expected in every other browsers I have tried.

    Does anyone have any ideas on how to make the <img> tags selectable in IE7, and how to make the highlighting work?

    The site is running the latest public builds of wordpress, gravity forms, and thesis.

    Things I have tried but can’t make work, thou I will admit that it may be user error on my part:
    http://snook.ca/archives/javascript/using_images_as
    http://www.tsd.net.au/blog/using-images-labels-fix-ie
    http://www.jotform.com/answers/23448-IE-problem-with-radio-buttons

    Posted 11 years ago on Sunday May 27, 2012 | Permalink
  2. Honestly, I think your best bet would be to just do a fallback for IE7 that routes to a normal radio field display. If you view the source in IE7 on your form you'll see on the wrapper you can target IE7 (and each browser for that matter). I wouldn't even waste anymore time with it.

    IE7 won't support the :checked or + selector anyways. When IE8 came out it's sole purpose was to pretty much finish up the CSS2 Selectors that were missing from IE7. That's why IE8 was only marginally better than IE7 and why IE9 still falls short when it comes to CSS3 and HTML5. It's the same pattern over and over...

    Posted 11 years ago on Sunday May 27, 2012 | Permalink
  3. I'm sort of coming to that conclusion, too. The amount of effort to solve this seems out of proportion to the number of people still using IE7/8. And if they are using them, they're probably used to their sites not looking so hot.

    Posted 11 years ago on Tuesday May 29, 2012 | Permalink
  4. At the end of the day, when it comes to IE7 - if it functions - you are good to go. :)

    Posted 11 years ago on Tuesday May 29, 2012 | Permalink
  5. It was fairly easy to add some IE specific rules, way easier that it was to try and make it work like everywhere else.

    These helped show me the way on the css/html/wordpress-
    http://webdesignerwall.com/tutorials/css-specific-for-internet-explorer
    http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
    http://jeffsebring.com/conditional-internet-explorer-classes-thesis/

    button styling-
    http://archivist.incutio.com/viewlist/css-discuss/86489
    https://github.com/twitter/bootstrap/issues/3181

    Posted 11 years ago on Tuesday May 29, 2012 | Permalink
  6. Right on, thanks for sharing!

    Posted 11 years ago on Tuesday May 29, 2012 | Permalink

This topic has been resolved and has been closed to new replies.