下拉列表框的格式java
<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>
單選框的格式post
<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>
複選框的格式this
<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 格式設置spa
<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>