MarlonV's avatar

First link in the foreach row doesn't work

Hi everyone,

I have a bit of a weird bug in my code, and I can't put my finger on it exactly what the problem is. The first in the row does not respond to a link. The second and subsequent is no problem, only the first one.

Does anyone have an idea where to look for this?

Thank you in advance

<table class="table table-sm table-striped table-hover">
    <thead>
    <tr>
        <th scope="col">#</th>
        <th scope="col">user #</th>
        <th scope="col">Name</th>
        <th class="actions">Checkin</th>
    </tr>
    </thead>
    <tbody>@foreach($children as $child)
        <tr>
            <th scope="row">{{ $child->id}}</th>
            <td>{{ $child->user->fullname()}}</td>
            <td>{{ $child->fullName()}}</td>
            <td>
                <form action="{{ route('admin.checkins.manualcheckin') }}" id="checkin{{$child->id}}" method="GET">
                    @csrf
                    <input type="hidden" id="barcode" name="barcode" value="{{ $child->barcode }}">
                    <input type="image" name="submit" form="checkin{{$child->id}}" onclick="return confirm('manual check-in?')" src="{{ URL::to('/') }}/images/iconic_svg/account-login.svg" style="width: 20px;" />
                </form>
            </td>
        </tr>
    @endforeach
</tbody>
</table>
0 likes
3 replies
Snapey's avatar

You mean the submit button does not work?

Have you checked browser console for errors?

Have you checked browser network tools to see if anything submitted?

Does the confirm dialogue appear?

MarlonV's avatar

Hi Snapey,

The button does submit, but not on the first one. The dialogue appears and then nothing happens. But next one does the job, and is the same piece of code.

no errors in the browser. also tried a button or text link, didn't make any difference. i tried Edge and Chrome.

Snapey's avatar

View source in the browser. Paste the results here for the first two rows of the table.

Please or to participate in this conversation.