dilfdo
1136
1
Laravel

keep drop down values after form submission

Posted 3 years ago by dilfdo

I want to keep my drop down selected values after submit the form . pls advice

 
  <form class="form-inline"  action="{{ action('TimesheetsController@store') }}" method="POST" >
                                <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                    <div class="section-one">
                                <div class="form-group driver-drop">
                                    <div class="input-group">
                                        <select class="form-control" id="user_id" name="user_id" required="required">
                                            <option disabled selected>Select Driver:</option>
                                            @foreach($Role_user as $Roles)
                                                        <option value="{{ $Roles->id }}">{{ $Roles->username }}</option>
                                            @endforeach
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <div class="input-group">
                                        <select class="form-control" id="week_starting_date" name="week_starting_date" required="required">
                                            <option disabled selected>Select Week:</option>
                                            @foreach($weeks as $weeks)
                                                <option value="{{ $weeks->id }}">{{ $weeks->week_starting_date }}</option>
                                            @endforeach
                                        </select>
                                    </div>
                                </div>
                                    </div>

          <div class="form-group">
                                            <div class="form-group">
                                            <div class="input-group">
                                        <button  style="width:160px;" type="submit" class="btn btn-default  btn-bottom-margin">Add Shift</button>
                                    </div></div>


                                        <div class="form-group">
                                            <div class="input-group">
                                                <button  style="width:160px;" type="reset" class="btn btn-default  btn-bottom-margin">Clear</button>
                                            </div>
                                        </div>

                                    </div>

                            </form>

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