Can not make MD Autcomplete working

Topic: Can not make MD Autcomplete working

assoumouad free asked 2 years ago

Expected behavior

Actual behavior No working

Resources (screenshots, code snippets etc.)


$("#form-autocomplete").on("keyup", function(e){
        url: '{{ route('autocomplete') }}',
        type: "GET",
        cache: false,
        data: { input: }//,
        //headers: { Authorization: "Bearer " + token } // your API token if needed
    }).done(function (response) {
        // Map response data if needed
        var data = (item) {
            return item.FirstName + item.Number
        $("#form-autocomplete").mdbAutocomplete({ data: data });


public function autocomplete(Request $request)
    $search = $request->get('query');
    $data = User::select('name')
    //$data = json_encode($result);
    //return $data;
    return response()->json($data);


... User name {{ csrf_field() }} Validate previous() }}">Cancel

Grzegorz Bujański staff commented 2 years ago

Hi. Autocomplete is a pro component. Did you have pro license?

assoumouad free commented 2 years ago

Hi, Yes, I have pro licence.

Grzegorz Bujański staff commented 2 years ago

Do You have any errors in console? Data from API is Array or JSON. I suppose it's JSON and that may be the reason. The data should be an array.

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.17.0
  • Device: PC
  • Browser: edge
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No