You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using ajax post to send the data where in my phrase is '10+1'. It shows response in console but the ul structure is not formed. It works properly when the phrase is '10+'. Any character after a special character results in no data in dropdown.
Hii,
I am using ajax post to send the data where in my phrase is '10+1'. It shows response in console but the ul structure is not formed. It works properly when the phrase is '10+'. Any character after a special character results in no data in dropdown.
This is my js code:
function productidajax(parentelement) { var productCodeoptions = { url: function (phrase) { return config.productlistname; }, getValue: function (element) { // console.log(element.product_name); return element.product_name; }, ajaxSettings: { dataType: "json", method: "POST", data: { dataType: "json" }, success: function (response) { console.log(response); if ($.isEmptyObject(response)) { $("#" + parentelement + " .product_id_cust").val(""); } }, }, preparePostData: function (data) { data.sales_org = jQuery('#organization').val(); data.phrase = $("#" + parentelement + " .product_id_cust").val(); data._token = $('meta[name="csrf-token"]').attr('content'); return data; }, placeholder: "Sélectionnez le produit", requestDelay: 1000, list: { onSelectItemEvent: function () { /*var selectedItemValue = $(this).getSelectedItemData().customer_id; // console.log(selectedItemValue); $("#client_id_pc").val(selectedItemValue).trigger("change");*/ var selectedItemValue = $("#" + parentelement + " .product_id_cust").getSelectedItemData().product_id; fillDetailsUsingId(selectedItemValue,parentelement); }, match: { enabled: true }, } }; setTimeout(function(e){ $("#" + parentelement + " .product_id_cust").easyAutocomplete(productCodeoptions); },2000) }
And this is in my controller:
$sales_org = $request->input('sales_org'); $phrase = $request->input('phrase'); $product_list = DB::table('product') ->select('product_id','product_ean','product_name','product_sku','product_unit','product_volume') ->where('sales_org', $sales_org) ->where('product_name','like',"%$phrase%") ->get(); echo json_encode($product_list);
The text was updated successfully, but these errors were encountered: