本文介绍了愚蠢的IE没有在组合框中显示选定的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IE中面临一个奇怪的问题,其他浏览器没有发生这种问题。打开以下网站:

I am facing a weird problem in IE which is not happening with other browsers. Open the following website:

您将在此页面上看到3个组合框,显示Lima。点击任意组合并选择任何其他值,如利马或阿雷基帕。页面将刷新,但现在组合将不会显示应该始终为利马的选定值(我已经硬编码)
如果您看一下视图源,那么它是一个简单的组合框,我甚至已定义选中=选择表示利马值,但在IE中,它仅在您打开主页时显示所选值。之后,当您从组合框中选择值时,它不会显示值。

You will see 3 combo boxes on this page displaying "Lima". Click on any combo and select any other value like Lima or Arequipa. Page will refresh but now combo will not show selected value which should always be "Lima" (I have hard coded it)If you take a look at the view source then it's a simple combo box and I have even defined selected="selected" for "Lima" value but in IE it only displays selected value when you open home page. After that it doesn't show value when you select value from combo box.

<select id="city_id" name="city_id" class="f2_city" onchange="redirect(this.form)">
    <option value="" selected="selected">LIMA</option>
    <option value="LIMA">LIMA</option>
    <option value="Arequipa">Arequipa</option>
</select>

我使用的是IE9。

推荐答案

我已经解决了这个问题。刚在页面中定义了这个。

I have fixed the issue. Just defined this in page.

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >

这篇关于愚蠢的IE没有在组合框中显示选定的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 18:26