Support the ongoing development of Laravel.io →
Input Database Forms
Last updated 2 years ago.
0

IIRC data-* attributes are used mainly for CSS and Javascript. You'll want to use the value attribute

<option value="{{ $dept->dept_code }}">{{ $dept->dept_name }}</option>
0

gizzmo said:

IIRC data-* attributes are used mainly for CSS and Javascript. You'll want to use the value attribute

<option value="{{ $dept->dept_code }}">{{ $dept->dept_name }}</option>

thanks gizzmo, how do we retrieve it then? I think Input::all() will not do the trick.

0
\Input:all();

Will give you all fields, so you would need to do something like

$input = \Input::all();
$var = $input['select'];

This assumes your select is named "select":

<select name="select">
,,,,

You might want to also look at "request" in the docs as well: http://laravel.com/docs/5.1/requests#retrieving-input

0

Sign in to participate in this thread!

Eventy

Your banner here too?

acbadz acbadz Joined 14 Jul 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.