我正在使用Chosen plugin作爲選擇框。我正在用ajax請求替換這兩個框。我希望複選框在預先填好時發出。我嘗試了一些,但失敗了。我讀了這個documentation並且無法完成。這是我閱讀文檔後所嘗試的內容。一旦ajax響應來了,我正在做這些事情。如何在頁面加載時將下拉(選擇)與選定值相結合。
var city = $('#hdnCity').val();
//**Ajax Request Goes and the response is here**//
$('#searchParams').html(responseText);
var value = $("#favCities1 option:contains("+city+")").attr('selected', 'selected');
$("#chzn-select").val(value).trigger("liszt:updated");
我無法做到這一點。幫手是可觀的。先謝謝你!!!
可你也 – 2013-03-27 05:00:21