0
文件名:BillToparty.jsp
問題 - 如果chargelist(BilltoParty)爲空,那麼我們需要顯示一個警報。如何驗證jsp中的列表是否爲空?
<c:forEach items="${chargeList}" var="charge" varStatus="count">
<td class="billToParty billingCharge${count.index}">
<c:if test="${not empty charge.arBillToParty}">
<c:choose>
<c:when test="${charge.arBillToParty eq 'A'}">
<c:set value="${charge.arBillToParty}" var="Agent"/>
<c:set var="agentTotalAmount" value="${agentTotalAmount + charge.rolledupCharges + charge.adjustmentAmount}" />
Agent
</c:when>
<c:when test="${charge.arBillToParty eq 'F'}">
<c:set value="${charge.arBillToParty}" var="Forwarder"/>
<c:set var="forwarderTotalAmount" value="${forwarderTotalAmount + charge.rolledupCharges + charge.adjustmentAmount}" />
Forwarder
<input type="hidden" id="fwdValidate" value="${charge.arBillToParty}">
</c:when>
</c:choose>
</c:if>
</td>
</c:forEach>
<input type="button" class="button-style1" value="Post" id="Post" onclick="postcheck();"/>
文件名:BilltoParty.js 我在這裏驗證
function postcheck() {
var flag=true;
if ($(".billToParty").val() === "") {
$.prompt("Please ensure all charge items have a bill to party");
flag = false;
}
}
確定......如果列表是空的,我們需要顯示一個警告。怎麼辦?點擊發布按鈕。我們需要檢查billtoparty是否爲空。如果空我們顯示以上警報 – Kuppu
請參閱我的更新 –
其不工作....注意這個
相關問題