One. Write script statements in all-cart-1.html
function Checkall (obj, name) {var el = document.getelementsbytagname (' input '); var len = El.length;for (var key in El) {if (El[key].name = = name) {if (obj.checked = = true) {el[key].checked = true;} else {el[key].checked = false;}}}
Select All button plus onclick
<th class= "Wp7_5" ><input type= "checkbox" onclick= "Checkall (This, ' checktest ')" class= "VM/> Select all </th >
Two. Increase the decrease button,cart-1.html to traverse multiple increase reduction buttons
<div class= "Chooseamount" > <a href= "javascript:void (0);" th:onclick= "${#strings. Concat (' Subnum ('). Concat (Cartsinfo.commodityid). Concat (') ')}" ></a> <input th: Id= "${cartsinfo.commodityid}" type= "text" class= "fl inp-t" value= "1"/> <a href= "javascript:void (0);" th:onclick= "${#strings. Concat (' Addnum ('). Concat (Cartsinfo.commodityid). Concat (') ')}" ></a></div>
Three. Each loop statement lists the shopping cart's multiple item information from the database
<tbody th:each= "Cartsinfo,status:${cartlist}" >//Loop statement <tr><td class= "CHK" ><input type= "checkbox" name= "CheckTest" /></td> <td><div class= "CONT&NBSP;CF" >
All counter-Select, increase the decrease button