模态框的表单怎么重置

如题所述

在模态的隐藏事件中可以调用表单重置`//模态隐藏调用$("#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());}});`
温馨提示:答案为网友推荐,仅供参考
第1个回答  2018-08-01
  在里的表单里面添加一个type="reset"的Button就可以了啊!点击后就会清空! 或者可以用循环遍历表单中的控件!软后让文本框的内容清空就ok啊!本回答被网友采纳