mardi 17 septembre 2019

Setting the initial position in select does not work

I want to display it in a loop for @foreach and display the corresponding one at the beginning

<label for="user_name">employee</label>
<select name="user_name">
    <option value="{!!null!!}" @if($param['user_name'] == '') selected @endif>no</option>
    @foreach($users as $user)
        <option value="" @if($param['user_name'] == '') selected @endif></option>
    @endforeach
</select>

However, this is not a good choice

Is there no good way

Aucun commentaire:

Enregistrer un commentaire