'How to show data from database inside textarea

Is it possible to show data with button modal datatable from database inside textarea? My case is, the button modal inside datatable area, and when I click the button it appears modal and data inside textarea. This is my code :

        ->addColumn('detail', function ($data) {
            $html = '
            <div class="d-flex justify-content-center">
                <button class="btn btn-light-success mx-2 btn-sm detail" '. $data->id .' ">
                    <i class="fa fa-search"></i>
                    Detail
                </button>
            </div>
            ';
            return $html;
        })

And this is a view :

<form action="{{route('accelerate-setting.submit_comment')}}" method="POST" class="load-form" enctype="multipart/form-data">
@csrf
<input type="hidden" name="id" value="">
<div class="modal-header">
    <h5 class="modal-title" id="exampleModalLabel">Detail Comment</h5>
    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
        <i aria-hidden="true" class="ki ki-close"></i>
    </button>
</div>

<div class="modal-body">
    <div class="form-group">
        <textarea class="form form-control" name="detail_comment" rows="6" disabled></textarea>
    </div>
    <button type="submit" name="action" class="btn btn-primary font-weight-bold btn-block" value="submit">Submit</button>
</div>

Thanks, hope u understand what my case is. I'm really confusing!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source