Skip to content

Suggestions not showing inside Table Row #1804

Open
@utsavDave97

Description

Describe the bug
Suggestions not showing inside Table Row

As you can see in the below screenshot whenever I click on Add Dependents it would dynamically add a table row as shown in the screenshot. Inside the screenshot you can also see that when I type A the console does output 4 suggestions but it is not being displayed or rendered in the browser.
Screen Shot 2022-05-05 at 8 23 58 PM

Moreover when the user taps Add Dependents this is the code which gets called.

var i = 0;
$("#add-dependent-button").click(function (e) {
    document.getElementById("dependentTable").style.display="block";
    ++i;
    $("#dynamicAddRemove").append('<tr><td><input class="typeahead2 form-control" type="text" name="dependents[' + i +
        '][client_id]" placeholder="Start typing name..." required"/></td><td><select class="form-control" id="relationship" name="dependents['+i+'][relationship]">@foreach($relationships as $relationship)<option value="{{$relationship->id}}">{{$relationship->relation}}</option>@endforeach</select></td><td><button type="button" class="btn btn-outline-danger remove-input-field">Remove</button></td></tr>'
    );
    $('input.typeahead2').typeahead({
        source:  function (query, process) {
            console.log(`${query}`);
            return $.get(path, { query: query }, function (data) {
                console.log(`${data}`);
                return process(data);
            });
        }
    });
    e.preventDefault();
});

I am using bootstrap and Laravel.

Appreciate your help!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions