lundi 16 août 2021

Why select input field is not working in laravel view?

I have facing an weird problem in my laravel application. In my view file there are a select input field where values are fetched from database table. I have checked that data successfully passed to the view and tried with below code which is not working

<div class="row form-group">
  <div class="col col-md-3">
    <label for="text-input" class=" form-control-label">Course</label>
  </div>
  <div class="col-12 col-md-9">
    <select class="form-control" name="course_id" id="course" required>
      <option value="">Please select</option>
      @if ($courses)
        @foreach ($courses as $course)
          <option value=""></option>
        @endforeach
      @endif
    </select>
  </div>
</div>

But when I have paste the same code again then the second input field is working properly. I didn't get any error.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3k0MaMK
via IFTTT

Aucun commentaire:

Enregistrer un commentaire