下拉列表框的格式
<div class="form-group"> <span><label class="col-sm-4 control-label">性别</label></span> <div class="col-sm-8"> <select class="form-control" name="gender" > <option value="男">男</option> <option value="女">女</option> </select> </div>
单选框的格式
<td class="chk"><input type="radio" name="addressId" class="vm" th:value="${receiveInfo.addressId}" th:checked="${addressDefault}==${receiveInfo.addressId}"/> <span th:text="${receiveInfo.receiveName}"></span></td>
复选框的格式
<input type="checkbox" id="checkAllId" onclick="checkAll(this);" class="vm" /> 全选</th> <td class="chk"> <input type="hidden" th:name="${#strings.concat(‘listBean[‘).concat(status.index).concat(‘].commodityId‘)}" th:value="${cartsInfo.commodityId}"/> <input type="hidden" th:name="${#strings.concat(‘listBean[‘).concat(status.index).concat(‘].cartId‘)}" th:value="${cartsInfo.cartId}"/> <input type="checkbox" th:name="${#strings.concat(‘listBean[‘).concat(status.index).concat(‘].checkArray‘)}" onclick="check();"/></td>
登录 页面的注释Validation 格式设置
<form action="guestLogin" th:object="${guestForm}" method="post" class="form-horizontal"> <br/> <span th:if="${#fields.hasErrors(‘${guestForm.*}‘)}"><i class="red" style="font-size:medium" th:errors="${guestForm.guestId}"></i></span> <br/> <span th:if="${#fields.hasErrors(‘${guestForm.*}‘)}"><i class="red" style="font-size:medium" th:errors="${guestForm.password}"></i></span> <br/> <span class="red" style="font-size:medium" th:text="${message}"></span>
原文:http://my.oschina.net/u/2412052/blog/493542