On the page for drawing the values, after entering the values into different fields, only the last ones are passed on.
There should be e.g.: for values v1, v2, v3, v4, v5 and groups g1, g2 the example result should be g1: v1, v3; g2: v2, v4, v5.
Actually it is: g2: v5 from the above example.
Where do I make a mistake? I'm very beginner, so there may be unintentional errors in the code. Here's my code.
Entering values. New fields appear when the button is pressed.
<div class="mx-auto position-relative form-wrapper">
<form method="post" id="form" action="{{route('randomizeValues.store')}}" name="form" class="form text-center"
data-response-message-animation="slide-in-left" novalidate>
@csrf
<div id="parent" class="list-group">
<div class="form-group form-filed horizontal">
<input name="values" class="input" type="text" autocomplete="off" placeholder="Enter value"
autofocus onkeypress='validate(event)' onkeydown="pressEnter(event)" required>
</div>
</div>
<div id="parent" class="list-group">
<div class="form-group form-filed horizontal">
<input name="groups" class="input" type="text" autocomplete="off" placeholder="Enter group"
autofocus onkeypress='validate(event)' onkeydown="pressEnter(event)" required>
</div>
</div>
<button type="submit" class="btn btn-lg btn-alternate align-center">Draw</button>
Display the results in tables.
<div class="section-heading text-center">
<h2>The following groups of results were drawn:</h2>
@foreach ($values_json as $value => $val)
<table class="table table-responsive">
<thead>
<tr>
<th style="width: 16.66%" scope="col">{{$value}}</th>
</tr>
</thead>
<tbody>
@foreach($val as $v)
<td> {{$v}}
{{$loop->last? "": " " }} </td>
@endforeach
</tbody>
</table>
@endforeach
<form method="post" id="form" action="{{route('randomizeValue.store')}}" name="form"
class="form text-center" data-response-message-animation="slide-in-left" novalidate>
@csrf
<button type="submit" class="btn btn-lg btn-alternate align-center">Draw again</button>
<a href="/randomizeValue" id="destroySession" type="submit"
class="btn btn-lg btn-alternate align-center">Cancel</a>
</form>
</div>
</form>
</div>