lundi 20 juin 2016

how to javascript data to controller laravel

i am new to laravel, i am trying to send javascript data to controller. in my view i have listed records using bootstrap table. when the user check the table row checkbox i want its id to get store in the a variable. and when the user click the add button it should send the id to the controller html code

<div class="col-md-12" >

                             <table class="table table-hover"  data-toggle="table"  id="table"
                             data-click-to-select="true">
                                <thead>
                                  <tr>
                                    <th data-field="state" data-checkbox="true" ></th>

                                    <th data-field="roomname">Room Name</th>
                                    <th data-field="Desc">Description</th>
                                    <th data-field="price">Price</th>
                                    <th data-field="roomid" data-visible="false">Price</th>
                                  </tr>
                                </thead>
                                <tbody >
                                  @foreach($roomname as $value)
                                  <tr>

                                    <td>{!! $value->roomid !!}</td>
                                    <td>{!! $value->roomname !!}</td>
                                    <td>{!! $value->Desc !!}</td>
                                    <td>{!! $value->price !!}</td>
                                    <td >{!! $value->roomid !!}</td>
                                  </tr>
                                  @endforeach
                                </tbody>
                              </table>



                    </div>
                    <div class="col-md-12">
                      <br>

                      <button id="add_cart" class="btn btn-warning">Proceed to booking</button>

</div>



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire