Monday, May 22, 2017

change the content of the page from the select operation in laravel

i have a select operation and there is three select form in it so when i select one of them it should change the content of the page or the page i mean this modal should change the body to another form when i select form 2 or 3 in the same modal

here is the code

<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" style="display: none;">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="myLargeModalLabel">Chose Form</h4>

                <div class="como">
                    <div class="form-group">
                        <select class="form-control">
                            <option >select form</option>
                            <option>1</option>
                            <option>2</option>
                            <option>3</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                @yield('formbody')
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-danger waves-effect text-left" data-dismiss="modal">Close</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->

--------------------------------------------------------------------------------
form 1
@section('formbody')
    any html code............ form1
@endsection

--------------------------------------------------------------------------------
form 2
@section('formbody')
    any html code............ form2
@endsection
--------------------------------------------------------------------------------
form 3
@section('formbody')
    any html code............ form3
@endsection

-------------------------------------------------------------------------------- 



via hamed alholi

Advertisement