发布网友
共2个回答
热心网友
在模态的隐藏事件中可以调用表单重置
` //模态隐藏调用
$("#jgdwModal").on("hide.bs.modal", function () {
type = undefined;
$("#inputLatitude").val('');//纬度
$("#inputLongitude").val('');//经度
document.getElementById("baseinfoform").reset();
$("#deptselect").select2('val', '');
$("#inputArea").select2('val', '');
$("#inputsshy").select2('val', '');
$("#baseinfoform").data('bootstrapValidator').resetForm();
if (nodeid != undefined) {
GetJCDwList(nodeid, $("#searchtext").val());
}
});`
热心网友
在里的表单里面添加一个type="reset"的Button就可以了啊!点击后就会清空! 或者可以用循环遍历表单中的控件!软后让文本框的内容清空就ok啊!