<form action="/admin/student/addsave" enctype="multipart/form-data" method="post" class="addform"
th:object="${student}">
<li>
<label>姓名:</label>
<input type="text" th:field="*{names}">
</li>
<li>
<label>性别:</label>
<input type="radio" name="sex" value="男" th:checked="*{sex=='男'}">男
<input type="radio" name="sex" value="女" th:checked="*{sex=='女'}">女
</li>
<li>
<label>血型:</label>
<select name="blood">
<option value="A" th:selected="*{blood=='A'}">A型</option>
<option value="B" th:selected="*{blood=='B'}">B型</option>
<option value="AB" th:selected="*{blood=='AB'}">AB型</option>
<option value="O" th:selected="*{blood=='O'}">O型</option>
</select>
</li>
<li>
<label>爱好:</label>
<input type="checkbox" name="hobby" value="篮球" th:checked="*{#strings.contains(hobby,'篮球')}">篮球
<input type="checkbox" name="hobby" value="足球" th:checked="*{#strings.contains(hobby,'足球')}">足球
<input type="checkbox" name="hobby" value="排球" th:checked="*{#strings.contains(hobby,'排球')}">排球
<input type="checkbox" name="hobby" value="网球" th:checked="*{#strings.contains(hobby,'网球')}">网球
</li>
<li>
<label>介绍:</label>
<script id="intro" name="intro" type="text/plain">[(*{intro})]</script>
<!--[(*{intro})]原样显示, 不转义-->
<!-- 配置文件 -->
<script type="text/javascript" src="/vendor/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="/vendor/ueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
var ue = UE.getEditor('intro');
</script>
</li>
<li>
<label>照片:</label>
<input type="file" name="myfile">
<div th:if="*{pic ne ''}">
<img th:src="'/' + *{pic}" style="max-width: 150px;">
</div>
</li>
<li>
<input type="hidden" name="id" th:value="*{id}">
<input type="submit" value="提交">
</li>效果如下:

