无线电框不重置为“检查”在Firefox中的状态 [英] Radio Boxes not resetting to "checked" status in Firefox

查看:108
本文介绍了无线电框不重置为“检查”在Firefox中的状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我失去了为什么我的收音机表格不能在Firefox 7.0.1中工作,但在IE,Chrome和Safari中正常工作。问题是,检查的广播箱没有重置为HTML显示的内容。例如,如果我将温度设置从f更改为c,然后按选择,则操作脚本将看到正确的值。然后按FF中的返回并刷新窗口,仍然选择c。如前所述,这在其他浏览器中可以正常工作,但不能在FF中使用。



我很难相信这个基本的东西在FF中被破坏了,但是HTML非常简单。



- Geoff

 < form name =form1method =POSTaction =weather_uom_set.php> 
< h3>降水< / h3>
< input type =radioname =precipvalue =inchecked =checked/>英寸()< br />
< input type =radioname =precipvalue =mm/>毫米(mm)< br />
< ;< h3>温度< / h3>
< input type =radioname =tempvalue =fchecked =checked/& >
< input type =radioname =tempvalue =c/>摄氏度(&℃;)< br / submitvalue =Submit/>
< / form>


解决方案

这可能是因为Firefox记住了以前的表单提交值,它可以覆盖你在HTML中定义的默认选项,而且即使你没有在这里说明,我想指出Javascript也可以重写默认的HTML行为,所以如果你有一个脚本运行,确保它也没有设置/覆盖默认值。


I'm lost as to why my radio box form isn't working in Firefox 7.0.1, but works fine in IE, Chrome and Safari. The problem is that the radio boxes which are "checked" aren't resetting to what the HTML shows.

For example, if I change the temperature setting from "f" to "c" and and press Select, the action script sees the correct values. I then press Back in FF and refresh the window, "c" is still selected. As stated, this works as expected in other browsers, but not in FF.

I'm having a hard time believing that something this basic is broken in FF, but the HTML is straight forward.

-- Geoff

    <form name="form1" method="POST" action="weather_uom_set.php">        
    <h3>Precipitation</h3>
    <input type="radio" name="precip" value="in" checked="checked"/> Inches (")<br/>
    <input type="radio" name="precip" value="mm" /> Millimeters (mm)<br/>
    <h3>Temperature</h3>
    <input type="radio" name="temp" value="f" checked="checked"/> Fahrenheit (&deg;f)<br/>
    <input type="radio" name="temp" value="c" /> Celsius (&deg;c)<br/>
    <input type="submit" value="Submit" />
    </form>

解决方案

It may be because Firefox is remembering the previous form submission values, which can override any default choices you've defined in your HTML. Also, even though you haven't stated it here, I'd like to point out that Javascript can also override default HTML behavior as well, so if you do have a script running, make sure it also isn't setting/overriding a default value.

这篇关于无线电框不重置为“检查”在Firefox中的状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆