您的位置:首页 > Web前端 > JavaScript

jsp中常用语句(包括js)

2009-12-13 15:37 197 查看
1.得到数组 在jsp中定义一个name为A的文本域等

var A = document.getElementsByName("A");

然后对他进行遍历就得到想要的值

2.对select的处理

<c:set var="originList" value="电话,邮件,传真,论坛,手机"/>
<select name="ORIGIN" id="ORIGIN">
<c:forEach items="${fn:split(originList, ',')}" var="item" varStatus="vs">
<c:choose>
<c:when test="${fn:contains(ntComplaint.ORIGIN,item)}"><option value="${item}" selected="selected">${item}</option></c:when>
<c:otherwise><option value="${item}">${item}</option></c:otherwise>
</c:choose>
</c:forEach>
</select>
必须加入fn标签:<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: