Why do my radio buttons all deselect when I hide a DIV in IE7?
I have a long form that's composed entirely of checkboxes and radio buttons and I've divided it up into开发者_JAVA技巧 a series of DIVs. I'm using the Tabs feature of jQuery UI to make each DIV appear when it is needed and disappear when it isn't (so there's only one DIV visible on the screen at any given time).
Here's the URL: http://plaza.ufl.edu/noproctor/FloraGator/key.html
The form works fine in Firefox and other versions of Explorer, but in IE7 on a PC the radio buttons always deselect whenever a DIV is hidden. Checkboxes work fine and keep your selections, but radio buttons just reset to the default value as soon as the DIV slides out of sight, so you can never submit a form with one of those selected.
Anybody know how to fix this?
See IE - hidden radio button not checked when the corresponding label is clicked -- sounds like hiding the elements offscreen instead of with display: none is going to be necessary if you want to support IE7 with this. So you'll probably have to rule out the jQuery UI tabs; they're using display:none & display:block. The good news is tab-like structures are very easy to write yourself with jQuery.
精彩评论