2012-05-09 54 views
0

我面临一个奇怪的问题在IE浏览器中,其他浏览器没有发生。打开以下网址:愚蠢的IE不显示在组合框中选定的值

http://www.clinicasdefertilidadenlima.pe/

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

<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。

回答

0

我修复了这个问题。刚才在页面中定义了这个。

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

我解决了使用jQuery n个:子选择上IE7/8/9铬/火狐等

var comboId = document.getElementById('YourDropDownListId'); 
var selectedIndex = comboId.selectedIndex; 
var selector = '#TableName:nth-child(' + selectedIndex.toString() + ')'; 
var selectedTable = $(selector).val(); 
工作