1、项目中有些功能不需要,但是删除会很麻烦,可以选择在界面隐藏这项功能。
style="displaly:;width:0"
2、jquery设置input标签
text文本框清空:$("#id").attr("value",'');
radio单选框选择第一个:$("input[name='radioname'][value=1]").attr("checked",true);
3、jstl实现if-esle
<c:chose>
<c:when test="${emtpy xxxx}"> 111111</c:when>
<c:otherwise>22222</c:otherwise>
</c:chose>
判断后台传来的值是否为空,为空显示111111,不为空显示22222
4、通过条件设置checkbox标签只读,用disabled来设置,
<c:forEach var="sfzb_each" items="${sfzb }" varStatus="var" >
<c:if test="${sfzb_each.code_value ne null }">
<input type="checkbox" name="sfzb" value="<c:out value=" ${sfzb_each.code_value }"/>" onClick="javascript:qxsfzb(document.all.sfzbqb,document.all.sfzb);"
<c:if test="${fn:contains(data.sydwrydz_zbzg,sfzb_each.code_value)}">
<c:out value=" checked" />
</c:if>
<c:if test="${sfzb_each.code_value=='3'}">
<c:out value=" disabled='disabled' " />
</c:if>
><c:out value=" ${sfzb_each.code_chin_name }"/>
</c:if>
</c:forEach>