Answer the question
In order to leave comments, you need to log in
How to pass value to onchange action?
There are two combobox fields (form-control):
<select class="form-control" id="soft_type" name="soft_type" required="required" onchange="changeCombo1()">
@foreach($result_types as $rtype)
<option>{!! $rtype->type !!}</option>
@endforeach
</select>
<select class="form-control" id="soft_name" name="soft_name" required="required">
@foreach($result_names as $rname)
<option>{!! $rname->name !!}</option>
@endforeach
</select>
Route::get('/', function () {
$result_types = DB::select('SELECT type FROM equip_cost GROUP BY type');
$result_names = DB::select('SELECT name FROM equip_cost GROUP BY name'); // where type="'.$data_type['soft_type'].'"');
$data = array('description' => ' Главная страница',
'title' => ' Главная страница',
'result_types' => $result_types,
'result_names' => $result_names
);
return view('index', $data);
});
$result_names = DB::select('SELECT name FROM equip_cost GROUP BY name'); // where type="'.$data_type['soft_type'].'"');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question