Youtta
9 months ago

Ajax call to fill HTML table

Posted 9 months ago by Youtta

I have the select dropdown:

  <select class="form-control" id="cup">
            @foreach($tourname as $value)
                <option value="{{ $value->tournament_id }}">{{ $value->name}}</option>
            @endforeach
        </select>

I want to show the table of specific ID records on the 'Onchange' event of ajax. Please guide Ajax I am new to it.

Table:

<table class="table table-sm table-hover  table-striped" id="table">
        <thead>
        <tr>
            <th>Club </th>
            <th>Vs</th>
            <th>Club</th>
            <th>Match Type</th>
            <th>Date</th>
            <th>Time</th>
            <th>Status</th>
            <th>Edit</th>
            <th>Delete</th>
        </tr>
        </thead>
        <tbody>

        @if($matches->count() > 0)


     
        @else

            <th colspan="5" class="text-center">No any matches</th>
        @endif



        </tbody>
    </table>

Please sign in or create an account to participate in this conversation.