zoukankan      html  css  js  c++  java
  • 每日记载内容总结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>                
    
  • 相关阅读:
    mysql触发器:插入数据前更新创建时间为服务器的时间
    import Vue form 'vue’的意思
    【LOJ#10172】涂抹果酱
    【LOJ#10171】牧场的安排
    【LOJ#10170】国王
    【POJ2411】Mondriaan's Dream
    【POJ2228】Naptime
    【CTSC1997】选课
    【CH5302】金字塔
    【洛谷P1168】中位数
  • 原文地址:https://www.cnblogs.com/cuiyf/p/2917329.html
Copyright © 2011-2022 走看看