2013-10-21 164 views
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>&nbsp;</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>&nbsp;</td> 
     <td>&nbsp;</td> 
     <td> 
     <input type="submit" name="submit" value="Create" 
     style="width:100px;" id="crt"></td> 
     </tr>