I need to select a dropdown value on an application and should be in a position to go back and update it.
I am using HTML and CSS in front end. and PHP as the backend language.
I am able to select a dropdown value and submit/update. I am using the code below:
@php
$followups= \App\Models\Followup::latest()->get();
@endphp
<div class="col-md-4 col-6">
<div class="form-group mb-30">
<label class="input-label mb-2">{{translate('Followup')}}*</label>
<select class="sselect-identity theme-input-style mb-30" name="followup">
<option value="">-- Select an option --</option>
@foreach($followups as $followup)
<option value="{{$followup->followup}}">
{{$followup->followup}}
</option>
@endforeach
</select>
</div>
</div>
However, when I go back to select a value in a dropdown. It is stuck and unable to select any other value. I am using the code below for a second edit/update of the dropdown:
@php
$followups= \App\Models\Followup::latest()->get();
@endphp
<div class="col-md-4 col-6">
<div class="form-group mb-30">
<label class="input-label mb-2">{{translate('Follow up')}}*</label>
<select class="select-identity theme-input-style mb-30" name="followup" required>
<option value="">{{ translate('Select an Option') }}</option>
@foreach ($followups as $followup)
<option value="{{ $followup->followup }}"
{{ $followup->followup === $userDeatials->followup ? 'selected' : '' }}>
{{ $followup->followup }}
</option>
@endforeach
</select>
</div>
</div>
I have tried using the html code to fetch the values from a database table. The same code is repeated in the update html code. It does recognize what value is selected in the first update. But I am unable to click on the dropdown and select any other value.