2011-11-27 67 views
1

我有jQuery UI的組合框元素添加到我的網頁:如何獲取服務器端的選擇值?

<select id="cbCountry" style="display: none; "> 
    <option value="1" selected>UK</option> 
</select> 

但是當我在服務器端(self.request.get('cbCountry'))它的價值,什麼都不會返回。這裏有什麼可能是錯的?

回答

5

您需要提供一個名稱,而不是(除了)您想要發佈的輸入的id。只有命名輸入由瀏覽器在POST中傳輸。

<select id="cbCountry" name="cbCountry" style="display: none; "> 
    <option value="1">UK</option> 
</select> 
相關問題