简体   繁体   English

为什么当我在 IE7 中隐藏 DIV 时,我的单选按钮全部取消选择?

[英]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 a series of DIVs.我有一个完全由复选框和单选按钮组成的长表单,我将它分成一系列 DIV。 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).我正在使用 jQuery UI 的选项卡功能使每个 DIV 在需要时出现,在不需要时消失(因此在任何给定时间屏幕上只有一个 DIV 可见)。

Here's the URL: http://plaza.ufl.edu/noproctor/FloraGator/key.html这是 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.该表单在 Firefox 和其他版本的资源管理器中工作正常,但在 PC 上的 IE7 中,每当隐藏 DIV 时,单选按钮总是取消选择。 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.复选框可以正常工作并保留您的选择,但只要 DIV 滑出视线,单选按钮就会重置为默认值,因此您永远不能提交带有选定选项之一的表单。

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.请参阅IE - 单击相应的 label 时未选中隐藏的单选按钮- 听起来像是将元素隐藏在屏幕外而不是显示:如果您想支持 IE7,则无需使用此按钮。 So you'll probably have to rule out the jQuery UI tabs;因此,您可能必须排除 jQuery UI 选项卡; they're using display:none & display:block.他们正在使用显示:无和显示:块。 The good news is tab-like structures are very easy to write yourself with jQuery.好消息是使用 jQuery 可以很容易地自己编写类似标签的结构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM