lundi 21 septembre 2015

pass value through tag in same page?

I use a href to call same page dialog box id.

this is my part of code

                  <tbody>                  

                        @foreach ($basl_officers as $basl_officer)
                        <tr >
                            <td><a href="#myModal" data-toggle="modal" data-target="#myModal"> {{ $basl_officer->code }} </a></td>        

                            <td align='center'>
                                {!! Form::open(['method' => 'DELETE', 'route'=>['basl_officers_page.destroy',$basl_officer->id]]) !!}
                                <a href="{{route('basl_officers_page.edit',$basl_officer->id)}}" class="btn btn-default btn-sm"> <span class="glyphicon glyphicon-pencil"></span> </a> &nbsp &nbsp
                                <button type="submit" class="btn btn-default btn-sm" onclick="return confirm('Are you sure?')"> <span class="glyphicon glyphicon-trash"></span> </button> 
                                {!! Form::close() !!}
                            </td> 
                        </tr>


                        @endforeach

                    </tbody>

//Model dialogue box code

 <!-- Modal -->
<div class="modal fade" id="myModal" role="dialog"> 
    <div class="modal-dialog">

        <!-- Modal content-->
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="btn btn-default" style='float: right;' data-dismiss="modal"><span class="glyphicon glyphicon-remove-circle"></span></button>
                <a href="#" class="btn btn-default" style='float: right;'> <span class="glyphicon glyphicon-trash"></span> </a>
                <a href="#" class="btn btn-default" style='float: right;'> <span class="glyphicon glyphicon-pencil"></span> </a>
                <h4 class="modal-title">BASL  Officers  Details {{ $basl_officer }} </h4>
            </div>



            <!-- text input -->
            <div class="modal-body">

                {!! Form::label('o_code', 'Officers Code: '); !!}
                {!! Form::text('officers_code', null, ['class' => 'form-control', 'id' => 'officers_code','disabled' => 'disabled']); !!}


                {!! Form::label('o_name', 'Officers Name: '); !!}
                {!! Form::text('officers_name', null, ['class' => 'form-control', 'id' => 'officers_name','disabled' => 'disabled']); !!}


            </div>
        </div>

    </div>
</div>

I want to pass select table row , $basl_officer object to this #myModal dialogue.is there any way to do this? please expect some expert help as soon as possible. since one week I try to do this different way .I use Laravel 5 framework.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire