samedi 21 avril 2018

Select option on laravel

Hi i m trying to insert a <select> <option> 1 </option> </select> but laravel not detect it in the request object. There is another option to put a spinner in a form? What i should use?

Here is my code:

tickets/create.blade.html

      <form action="" method="POST">

<div class="col s12">
  <input type="text" name="title" value="">
</div>
<div class="col s12">
  <input type="text" name="content" value="">
</div>
<div class="row">
  <div class="input-field col s12">
    <select>
      <option value="1">1</option>
      <option value="2">2</option>
      <option value="3">3</option>
      <option value="4">4</option>
    </select>
  </div>
</div>
<div class="row">
  <div class="input-field col s12">
    <input type="submit" value="Crear Incidencia">
  </div>
</div></form>

TicketsController

public function store(Request $request)
{

    return $request->all();
}

Response:

{"_token":"mnqsWAG9DQ7s8cCvHWmFsgJlHl2aqgMP9RvmfhRt","title":"Hello","content":"Bye"}

As you see the request not contains the number that i selected.



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

Aucun commentaire:

Enregistrer un commentaire