如何在引导模式框中重置表单主体? [英] How to reset form body in bootstrap modal box?

查看:145
本文介绍了如何在引导模式框中重置表单主体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



问题在于,当用户输入其数据提交表单并再次打开modalbox时,系统会显示一个空表单那么它会显示以前给出的数据:。我怎样才能在模型窗口中简单刷新窗体?

解决方案

在Bootstrap 3中,已关闭,如下所示:

  $('。modal')。on('hidden.bs.modal',function( ){
$(this).find('form')[0] .reset();
});


I am finding a way to always get empty form when opening bootstrap modalbox without refresing page.

Problem is that when user enters its data submit form and open modalbox again then it shows previous given data :. how can i compeletly refresh the form onclose modelbox ????

解决方案

In Bootstrap 3 you can reset your form after your modal window has been closed as follows:

$('.modal').on('hidden.bs.modal', function(){
    $(this).find('form')[0].reset();
});

这篇关于如何在引导模式框中重置表单主体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆