2012-05-09 55 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(); 
工作