Я пытаюсь передать выбранное id
в controller
, используя route
. Но ничего не показано в другом файле блейда. Вот мой код
мой блейд содержит этот скрипт
$("#state").on("change", function() {
var id = $(this).val();
console.log(id)
var cuid = document.getElementById("cu").value;
console.log(cuid)
});
состояние выбора
<div class="col-md-12 form-group" id="stateBranch">
<label for="sm" class="control-label">{{ __('messages.state') }}</label>
<select name="state" id="state" class="input-sm form-control">
<option value="">{{ __('messages.select') }}</option>
@if(!empty(request()->session()->get('stateList')))
@foreach(request()->session()->get('stateList') as $state)
<option value="{{ $state->st_state_code }}">{{ $state->st_state_desc }}</option>
@endforeach
@endif
</select>
</div>
cu select
<div class="col-md-12 form-group" id="custbranchreport">
<label for="sm" class="control-label">{{ __('messages.module.customer') }}<span class="compulsory"> * </span></label>
<select name="cu" id="cu" class="input-sm form-control" onchange="">
<option value="">{{ __('messages.select') }}</option>
@if(!empty($custList))
@foreach($custList as $cu)
<option value="{{ $cu->cu_customer_ID }}">{{ $cu->cu_customer_Shortname }}-{{ $cu->cu_customer_Name }}</option>
@endforeach
@endif
</select>
<input id="hid" type="hidden" name="hid" value=""/>
</div>
открыть новое окно маршрута с помощью onclick
<a class="btn btn-sm btn-default pull-right" type="button" title="Search Branch" onclick="openNewWindow('{{ route('reporting.branchCheckBoxList', ['cu' ,'state']) }}')" ><i class="fa fa-hand-o-up"></i> Choose Branch</a>
маршрутов / сети. php
Route::get('reporting/branchCheckBoxList/{cuid}/{stid?}','GenReportController@branchCheckBoxList')->name('reporting.branchCheckBoxList');
Контроллер
public function branchCheckBoxList(Request $request) {
$cuid = $request->get('cuid');
$stid = $request->get('stid');
return view('report.BranchCheckBoxList', compact('cuid','stid'));
}