2016-04-14 112 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.