您的位置:首页 > 其它

每日记载内容总结2

2013-02-19 16:42 351 查看
1.部分css内容

border-collapse:collapse
border-collapse 属性设置表格的边框是否被合并为一个单一的边框
colspan  colspan 属性规定单元格可横跨的列数。


2.jsp里面加入java代码实现select的option

<select name="bookTypeId">
<%
  List<BookType> bookType=(List<BookType>)request.getAttribute("bookType");
  for(BookType bookType : bookTypes) {
%>
  <option values="<%=bookType.getBokkTypeId()%>"><%=bookType.getBookTypeId()%></option>
<%}%>
</select>


3.根据java传值判断checkbox是否选中

var displayPrice=$("#displayPrice").attr("value");
if(displayPrice=="Y"){
$("#displayPrice").attr("checked",true);
}else{
$("#displayPrice").attr("checked","");
}


4.select判断传入值并设置默认值

<select name="condition" id="condition">
<option value="1" ${productBean.condition== "1" ? 'selected' : '' }>NEW</option>
<option value="2"  ${productBean.condition== "2" ? 'selected' : ''}>USED</option>
</select>


5.在select中用foreach接受传入的list并设置默认值

<select class="manufac" name="manufName"  id="manufName">
<c:forEach items="${manufacturers}" var="manuf" varStatus="status">
<option value="${manuf.manufacturerId}" ${productBean.manufacturerId eq manuf.manufacturerId ? "selected='selected'" : ""}>
${manuf.manufacturerName}</option>
</c:forEach>
</select>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: