Friday, March 17, 2017

passing value of selectbox from view to controller in laravel

I have form which has one select box and i need to pass select box selected value to laravel resources show() method for display specific details of selected value.

<form action="" method="POST" class="form" role="form">
  <div class="form-group">
      <label for="inputEmail3" control-label">company name</label>
      <select class="form-control js-example-basic-single" >
        <option value=""></option>
        @foreach($supplierlist as $supplier)
          <option value=""></option>
        @endforeach
      </select>
  </div>

  <input type="hidden" name="_token" value="">
  <button type="submit" class="btn btn-primary">GO</button>
</form>

Values of selectbox come from database so how can i pass value of selected value of selectbox to my controller.



via user3649115

Advertisement