2016-04-14 44 views
1

我有以下生成的jQuery表:laravel 4.2 Get生成從查看/刀片HTML表格/ HTML

<table class="table table-striped table-condensed quotation_table"> 
     <thead> 
      <tr> 
      <th width="5">QTY</th> 
      <th width="150">Description</th> 
      <th width="150">Amount Per Candidate</th> 
      </tr> 
     </thead> 
     <tbody> 
      <tr> 
       <td>5</td> 
       <td>some stuff</td> 
       <td>$43</td> 
     </tr> 
    </tbody> 
    </table> 

我想獲得<td>從表中我控制器 正常的方式來獲得數據將使用Input::except('_token'),但我無法使用此方法獲取表數據。

如何使用laravel 4.2獲取表格數據。謝謝:)

+0

我認爲你將不得不使用'jQuery'比讓你從表中所需要的數據使用您收集的數據在'controller'中對該特定'method'進行'AJAX'調用。 – musicvicious

+0

我正在考慮使用jQuery來製作​​的隱藏輸出,但這聽起來像是hackash @musicvicious – LeRoy

+0

你究竟要做什麼? – musicvicious

回答

0

這感覺非常hackash,請評論,如果你有一個更好的解決方案。但這種解決方案,您可以添加一個隱藏的令牌,驗證並把它放進一個POST形式

{{ Form::open(array('url'=>'/sendLearnerDetails', 'class'=>'form-horizontal form-group ', 'method' => 'post')) } 

<div class="container"> 
    <table class="table table-striped table-condensed quotation_table"> 
    <thead> 
     <tr> 
     <th width="5">QTY</th> 
     <th width="150">Description</th> 
     <th width="150">Amount Per Candidate</th> 
     </tr> 
    </thead> 
    <tbody> 
     <tr> 
     <td> 
      <input name="qty" type="text" class="form-control" id="qty" value="5" readonly="readonly"> 
     </td> 
     <td> 
      <input name="description" type="text" class="form-control" id="description" value="some stuff" readonly="readonly"> 
     </td> 
     <td> 
      <input name="amountPerCanditate" type="text" class="form-control" id="amountPerCanditate" value="$43" readonly="readonly"> 
     </td> 
     </tr> 
    </tbody> 
    </table> 
</div> 
{{ Form::submit('Approve table', array('class' => 'btn btn-primary')) }} 
{{ Form::close() }} 

Fiddle example.