我的Ajax提交具有重力形式。成功提交表单后,我想重置表单字段值,以使用户可以多次提交。并且无需刷新页面。谢谢!
答案 0 :(得分:0)
Gravity Forms Reload Form插件提供此功能:
https://gravitywiz.com/documentation/gravity-forms-reload-form/
它可以在x秒后自动重新加载-或-您可以在表单确认中创建重新加载链接。
答案 1 :(得分:0)
我知道这是一个旧线程,但如果其他人正在寻找合适的解决方案,这可能会奏效。
我一直在测试 Gravity Form API 和一堆其他重置解决方案,最终得到了这个 jQuery 解决方案:
(function($) {
$(window).load(function() {
if($('#gform_18')) { //change to the ID of your form
$("form").each(function(){
$(this).find(':input').val('');
$(this).find('.gfield_error').removeClass('gfield_error');
$(this).find('.validation_message').remove();
});
}
});
}(jQuery));