复选框选择提交电话

时间:2016-09-21 14:05:19

标签: jquery html

我需要在表格中选中复选框时进行发布呼叫。当我选择我正在选择的特定行的复选框时,需要传递行信息。

现在我很想得到所选的表格行信息,唯一的事情就是我无法向后端提交信息。

注意:我不想进行ajax调用。我需要再次重新加载页面。

代码:

<script type="text/javascript">
    $(function() {

        $(".chcktbl").change(function() {
            if(this.checked) {
                alert("ddd");
                var chk = $(this).closest('tr').find('input:checkbox'); 
                var data = $(this).parents('tr:eq(0)');
                alert( $(data).find('td:eq(1)').text());
                alert( $(data).find('td:eq(2)').text());
            }
        });
    });
</script>

 <div id="searchContainer">
<span class="addmessage">${flashMessage}</span>
<form method="post"
    action="/InformationManagement/mrps/getDepositSearch"
    class="searchCriteria">
    <div class="searchform">
        Select the Search Column Name <select class="dropmenu"
            name="searchCondition">
            <option value="NONE">--- Select ---</option>

            <c:forEach items="${searchAllContents.searchContent}" var="record">
                <%-- <c:if test="${searchAllContents.searchContent} ==''">
        <option value="${record.key}" selected>${record.value}</option>
        </c:if> --%>
                <c:choose>
                    <c:when test="${record.key=='DPST_NUM'}">

                        <option value="${record.key}" selected>${record.value}</option>
                        <option value="DPST_DTE">Deposit Date</option>
                    </c:when>
                    <c:when test="${record.key=='DPST_DTE'}">
                        <option value="DPST_NUM">Deposit Number</option>
                        <option value="${record.key}" selected>${record.value}</option>

                    </c:when>
                    <c:otherwise>


                        <option value="DPST_NUM">Deposit Number</option>

                        <option value="DPST_DTE">Deposit Date</option>

                    </c:otherwise>
                </c:choose>
            </c:forEach>

        </select> Search <input type="text" id="searchText" name="searchText"
            value="${searchText}" />
        <!-- <button class = "refreshButton">Refresh</button> -->
        <input type="submit" class="submit" />
    </div>
   </form>
   </div>
    <div>
   <form name="test" id= "testid" action="Controller" method="post">
<table style="width:100%">
 <tr>
 <th></th>
   <th>Deposit Date</th>
   <th>Deposit Number</th> 
  <th>Deposit Status</th>
  </tr>

  <c:forEach items="${depositDetails}" var="depositDetails">

   <tr>
  <td><input type="checkbox" class = "chcktbl" /></td>
   <td>${depositDetails.DPST_DTE}</td>
  <td>${depositDetails.DPST_NUM}</td> 
   <td>${depositDetails.PMT_STS}</td>

</tr>

</c:forEach>

  </table>
    </form>
  </div>

0 个答案:

没有答案