0
在我的形式我想FETCH项目描述使用项目代码例如我有项目描述为24“STUB结束316L SCH10S和它的项目代码是STUB316LS10SW所以当我在项目代码搜索使用STUB316LS10SW针对特定项目代码项目描述字段不是因为在获取项目说明我24" ,即特殊字符,所以Ajax不是取物品描述..can请您对这个Ajax没有采取字符串或值与特殊字符
$(function() {
function log(message) {
$("<div>").text(message).prependTo("#log");
$("#log").scrollTop(0);
}
$("#itemcode1").autocomplete({
source: function(request, response) {
$.ajax({
url: "getProductList.php",
dataType: "json",
data: {
name_startsWith: request.term
},
success: function(data) {
response($.map(data.geonames, function(item) {
return {
label: item.name + (item.adminName1 ? ", " + item.adminName1 : "") ,
value: item.nameval,
value1: item.toponymName,
price:item.price,
quantity:item.quantity,
prodId:item.prodId,
itemcode:item.itemcode,
}
}));
}
});
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="style1">
<tr>
<td>Item Code </td>
<td> </td>
<td><input type="text" id="itemcode1" name="itemcode1" /></td>
</tr>
<tr>
<td width="125">Products/Description</td>
<td width="10">:</td>
<td width="175"><input name="productDesc1" type="text" id="productDesc1"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>
<input type="submit" name="submit" value="Create"
style="width:100px;" id="crt"></td>
</tr>
我不确定,但我认为你的PHP脚本可能会有一个不同于你的' ", false) });
相关问题