每日记载内容总结2

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>                

 

转载于:https://www.cnblogs.com/cuiyf/archive/2013/02/19/2917329.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值