I have in my view two selections with data, which I want to capture their values. I can do it with a select and the $.get
method, but I do not know how to do it so I can capture two data and take it to a controller.
I do not know if my problem is understood, but I leave what I have to capture a single data.
Route:
Route::get('imp/{id}', 'VentasController@getIva');
Controller:
public function getIva(Request $request, $id)
{
//$test = M_DCVT::where('id' , '=' , $id)->select('mimpcd_id')->first();
//$test = $test->mimpcd_id;
if($request->ajax()){
//$imp = M_IMPT::Iva($id, foo);
//return response()->json($imp->mimpts);
}
}
Script:
$("#mdccod_id").change(function(event){
var select = $('#msocod_id option:selected').val();
$.get("/imp/"+event.target.value+"",function(response){
$("#hidden").val(response)
});
});