0
我想獲得文本框中的值和它的工作,但主要問題是當我從選擇框更新供應商current_vendor
變量更改其值但在自動完成功能源URL保持舊的current_vendor
值是0
,而不是新的,我不知道我做錯了或丟失這裏是我的代碼jQuery自動完成未得到更新值
$(document).ready(function(){
var current_vendor = 0;
$("select[name=txtvendor]").change(function() {
var current_vendor = $(this).find("option:selected").val();
});
$("input#ProdDescription").autocomplete({
source: "includes/modProducts/search-products.php?viewVendor="+current_vendor,
minLength: 1,
select: function (event, ui) {
var item = ui.item;
if(item) {
$(this).closest('.row').find('.txtchassis').val(item.ChassisNo);
$(this).closest('.row').find('.txtdescription').val(item.BikeDescription);
$(this).closest('.row').find('.txtprice').val(item.SellingAmount);
$(this).closest('.row').find('.txtbikeid').val(item.BikeID);
$(this).closest('.row').find('.txtcostprice').val(item.CostPrice);
$(this).closest('.row').find('.txtcolorcode').val(item.ColorCode);
}
}
});
});