2013-02-28 73 views
0

我需要为我的表添加一个函数,所以当通过复选框选中多行并按下“select”按钮时,应该弹出另一个JSP页面来提交选定的行。我想要“选择”按钮来选择行并弹出提交页面进行提交。提交选中的复选框

enter image description here enter image description here

表JSP:

<table id="summaryTable" class="tablesorter" > 
<thead> 
<tr> 
<th>&nbsp;</th> 
<th>Bar Code</th> 
<th>Origin</th> 
<th>Sender Name</th> 
<th>Recipient Name</th> 
<th>Receipt Date</th> 
<th>Load Date</th> 
<th>Forecast ISC</th> 
<th>Actual ISC</th> 
<th>Country</th> 
<th>Source</th> 
<th><input type="submit" name="selectCheckBox" value="Select"></th> 
</tr> 
</thead> 
<tbody> 
<tr> 
<c:forEach items="${summary}" var="summary"> 

<tr> 
<td><c:out value="${summary.eventDesc}" /></td> 
<td><c:out value="${summary.labelNbr}" /></td> 
<td><c:out value="${summary.origin}" /></td> 
<td><c:out value="${summary.senderName}" /></td> 
    <td><c:out value="${summary.receiverName}" /></td> 
    <td><c:out value="${summary.receiptDate}" /></td> 
    <td><c:out value="${summary.loadDate}" /></td> 
<td><c:out value="${summary.forecastIsc}" /></td> 
    <td><c:out value="${summary.actualIsc}" /></td> 
    <td><c:out value="${summary.country}" /></td> 
    <td><c:out value="${summary.source}" /></td> 
    <td><input type="checkbox" value=""></td> 
    </tr> 
    </c:forEach> 

回答

0

你好,这是检查选择框的代码,但我不明白,你到底要以后做什么。

  $.each($("input[type=checkbox]:checked"),function(){ 
       //your code here 
      }); 
+0

谢谢您的回答一样。如果你发现我在复选框列标题选择按钮。我需要该选择按钮来选择表格中的所有选中框,然后将其提交到另一个jsp页面以供最终提交。 – Fahad 2013-02-28 20:51:56

0

您能否清除'popup submit page'部分? 对于第一部分的代码应该是这个

$('[name="selectCheckBox"]').on('click', function() { 
    $('[type="checkbox"]').prop('checked', true); 
    //$.ajax call here if you just want to post it to the backend 
}); 
+0

好的..我添加了我的提交页面的图像(验证决定)。当用户选中一个框并按下选择按钮时,应该弹出提交页面。在Verification Decision页面上,用户为所有选定的行(通过按下表上的选择按钮选择)选择一个单选按钮并提交表单。我希望它不要太混乱。 – Fahad 2013-02-28 21:23:46

+0

所以基本选择按钮应该只选中复选框,并弹出验证决策页面,最终提交Verification选择页面中的选定行。 – Fahad 2013-02-28 21:29:17