2017-01-07 1 views
0

Ich habe die folgende Form:Laravel - Antrag enthält nicht meine Eingaben

<div class="container text-center search-container"> 
    <form id="search-form" action="" method="post"> 
     <div class="nopadding col-xs-12 col-sm-2"> 
      <select name="huge" class="form-control input-block-level selectpicker search-selector" data-style="btn-default btn-fill btn-block"> 
       <option disabled>Search in...</option> 
       <option value="1" selected>foo1</option> 
       <option value="2">foo2</option> 
       <option value="3">foo3</option> 
      </select> 
     </div> 
     <div class="nopadding col-xs-12 col-sm-8"> 
      <input type="text" class="form-control input-block-level search-bar" id="searchbar"> 
     </div> 
     {{ csrf_field() }} 
     <div class="nopadding col-xs-12 col-sm-2"> 
      <button class="btn btn-info btn-fill search-button input-block-level" type="submit">Search</button> 
     </div> 
    </form> 
</div> 

Ich benutze bootstrap-select für das select Element.

Dies ruft eine Methode in meinem Controller, aber wenn ich einen dd($request->all() tun, hier ist das, was ich erhalten:

array:2 [▼ 
    "huge" => "1" 
    "_token" => "somethingReallyLongAndBoring" 
] 

Grundsätzlich bin ich nicht in der Lage meine Eingaben abzurufen. Irgendeine Idee, was ich falsch gemacht habe?

Antwort

3

Sie müssen dem Eingabefeld das Attribut name hinzufügen.

<input type="text" class="form-control input-block-level search-bar" id="searchbar" name="searchbar">

+0

Ich bin dumm, danke :) – EddaSnorra

Verwandte Themen