<div class="mui-input-row">
<label>预约时间</label>
<%-- <input type="text" name="timeType" placeholder="每周三15点-17点,每周日15-17点,具体时间会在申请时间成功后2-3个工作日给您确认">--%>
<select id="timeType1" class="timeType1" name="timeType1" style="margin: 4px 0;">
<option value="0">请选择</option>
<option value="everyWednesday">每周三15点-17点</option>
<option value="everySunday">每周日15点-17点</option>
</select>
</div>
后台提交方法: student.setTimeType(StringUtils.isBlank(timeType1) ? null : TimeOfAppointmentType.valueOf(timeType1));
/**
* 提交执行操作
*/
@RequestMapping(value = "/executeStudentSubmit", produces = {"text/plain;charset=UTF-8"})
@ResponseBody
public String executeStudentSubmit(Student student, @RequestParam(value = "timeType1", required = false) String timeType1) {
try {
student.setTimeType(StringUtils.isBlank(timeType1) ? null : TimeOfAppointmentType.valueOf(timeType1));
studentBiz.addOrUpdate(student);
} catch (Exception e) {
e.printStackTrace();
System.out.println("新增异常:{}"+ e);
return "新增失败";
}
return "1";
}
表单提交方法
//提交
function submitEdit() {
validate();
//判断是否选中checkboxyi已阅读并同意按钮
if($("input[type='checkbox']").is(':checked')){
//改变按钮颜色background:#1dab17;
var params = $('#student').serialize();
console.log(params)
$.ajax( {
type : "POST",
url : "<c:url value="/wechat/admin/student/executeStudentSubmit.action" />",
/*contentType: "application/json",*/
data : params,
success : function(msg) {
window.location='<c:url value="/wechat/admin/student/getApplySuccess.action"/>';
}
});
}else {
alert("您已阅读并同意吗?");
}
}