标签:
1、register-1.html
<form action="addGuest" th:object="${guestForm}" method="post" class="form-horizontal"> <div class="form-group"> <span><label class="col-sm-4 control-label">用户ID:<span style="display:inline;color:red;">*</span></label></span> <div class="col-sm-8"> <span><input name="guestId" type="text" th:value="${guestForm.guestId}" class="form-control"/></span> <i class="red" style="font-size:medium" th:errors="${guestForm.guestId}"></i> <span class="red" style="font-size:medium" th:text="${message}"></span> </div> </div> <div class="form-group"> <span><label class="col-sm-4 control-label">密码:<span style="display:inline;color:red;">*</span></label></span> <div class="col-sm-8"> <span><input name="password" type="password" class="form-control"/></span><i class="red" style="font-size:medium" th:errors="${guestForm.password}"></i> </div> </div> <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> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btnYellow yh">提交</button> </div> </div> </form>
下面的语句用来显示验证信息
<i class="red" style="font-size:medium" th:errors="${guestForm.guestId}"></i>
2、后续操作参照--显示验证信息的介绍
包括validation gustForm
标签:
原文地址:http://my.oschina.net/u/2411782/blog/492515