6 days ago

How to get old value on select option ?

Posted 6 days ago by adhik13th

i have filter form using select dropdown , but i cant get this old value after i submit this filter like input like type text . someone can help ?

<div class="form-group">
        <select class="form-control select2 select2-hidden-accessible" style="width: 100%;" data-select2-id="1" tabindex="-1" aria-hidden="true"
                    name="user_id" id="user_id" required
                      @foreach($unit as $id => $nama_unit )
                      <option value="{{ $id }}">{{ $nama_unit }}</option>
        <div class="help-block with-errors"></div>

i add my function controller :

public function search_filter_alkes(Request $request)
    $unit        = User::where('roles_id' , 1)->pluck('nama_unit', 'id'); 
    $user_id = $request->user_id;
    $alat = Alat::with('users')->where('user_id',$user_id)
    ->where('jenis', 'Alkes')->


    return view('sarpras.alkes',['user_id' => $user_id , 'unit' => $unit,'alat' => $alat  ])
    ->with('user_id', $user_id)


Please sign in or create an account to participate in this conversation.