前端汇总----Jsp 标签--forEach、choose、when、otherwise、fmt、if 包括 ajax、jQuery 等各种操作汇总《来自于英科》

jQuery

1.获取 下拉框的选中的value

<select title="还款类型" name="repaymentType" id="repaymentType">
			<c:forEach items="${ALL_REPAY_TYPE}" var="type">
					<option value="${type.key}">${type.value}</option>
			</c:forEach>
</select>



<!-- jQuery 获取: -->
var checkType=$("#repaymentType option:selected").val();

 

2.html textarea 标签使用

<textarea title="备注" name="remark" rows="5" cols="60" maxlength="50">${backUser.remark }</textarea>

3.函数互相调用

<script type="text/javascript">
	function submitFrm(){
		var checkType=$("#repaymentType option:selected").val();
		var checkNum=$("#orderId").val();	
		var trueRepaymentMoney = parseFloat($("#trueRepaymentMoney").val());
		
		if(trueRepaymentMoney <= 0){
			alertMsg.error('请输入有效的还款金额!');
			return false;
		}else if((checkType=='2'&&checkNum.length!=15)||(checkType=='3'&&checkNum.length!=15)){
			//富有和连连15位订单号
				alertMsg.error('请输入正确的订单号!');
				return false;
		}
		subRepay(trueRepaymentMoney); <!------------ 开始函数调用 --------------->
	}
	
	<!---------------------  被调用函数  --------------------------->
	function subRepay(trueRepaymentMoney){
		if(parseFloat("${remainMoney}") < trueRepaymentMoney){
			if(confirm('还款金额大于剩余待还金额,确定继续操作还款?')){
				$("#frm").submit();
				return;
			}else{
				return false;
			}
		}
		$("#frm").submit();
	}
	
</script>

1.c:if 标签

​
<table class="searchContent">
	<tr>
		<td>资金类型: 
			<select name="repayChannel"  id="repayChannel">
			    <option value="">全部</option>
	                    <option <c:if test="${params.repayChannel eq 1}">selected="selected"</c:if> value="1" name="repayChannel" value="${params.repayChannel }">本息</option>
			    <option <c:if test="${params.repayChannel eq 2}">selected="selected"</c:if> value="2" name="repayChannel" value="${params.repayChannel }">补利息</option>
			    <option <c:if test="${params.repayChannel eq 3}">selected="selected"</c:if> value="3" name="repayChannel" value="${params.repayChannel }">本金</option>
			</select>
		</td>
	</tr>
</table>

​<td align="center">
		<c:if test="${rec.repayKoudaiType==0}">待处理</c:if>
		<c:if test="${rec.repayKoudaiType==1}">待还</c:if>
		<c:if test="${rec.repayKoudaiType==2}">正常还款</c:if>
		<c:if test="${rec.repayKoudaiType==3}">担保户垫付</c:if>
		<c:if test="${rec.repayKoudaiType==4}">担保户垫付待还</c:if>
		<c:if test="${rec.repayKoudaiType==5}">问题还款</c:if>
		<c:if test="${rec.repayKoudaiType==6}">异常订单</c:if>
</td>

2.forEach、choose、when、otherwise、fmt

<c:forEach var="borrow" items="${pm.items }" varStatus="status" >
                    <tr>
                        <td align="center">${borrow.lateday}</td>
                        <td align="center"><fmt:formatDate value="${borrow.orderTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                        <td align="center">
                            <c:choose>
                                <c:when test="${ null != borrow.repaytime }">
                                    <fmt:formatDate value="${borrow.repaytime }" pattern="yyyy-MM-dd HH:mm:ss"/>
                                </c:when>
                                <c:otherwise>
                                    ---
                                </c:otherwise>
                            </c:choose>
                        </td>
                        <td align="center">
                            <c:choose>
                                <c:when test="${null != borrow.repayrtime}">
                                    <fmt:formatDate value="${borrow.repayrtime }" pattern="yyyy-MM-dd HH:mm:ss"/>
                                </c:when>
                                <c:otherwise>
                                    ---
                                </c:otherwise>
                            </c:choose>
                        </td>
                        <td align="center"> ${statusMap[borrow.status] }</td>
                    </tr>
                </c:forEach>

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值