本文介绍了成功提交表单时,重力表单会触发 js 事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在成功的ajax表单传输中是否可以在重力表单中触发javascript事件?

Is it in gravity forms anyhow possible to fire an javascript event on an successful ajax form transmittion?

将 html javascript 添加到显示的响应中似乎不起作用,例如:

Adding html javascript into the displayed response does not seem to work eg:

<script>console.log("successful-form-transmition");</script>

推荐答案

成功提交 Gravity Forms 后会触发一个事件:gform_confirmation_loaded.你可以像这样在 jQuery 中使用它:

There's an event fired upon successful Gravity Forms submission: gform_confirmation_loaded. You can use it with jQuery like so:

$(document).on("gform_confirmation_loaded", function (e, form_id) {
  // code to run upon successful form submission
});

查看文档

这篇关于成功提交表单时,重力表单会触发 js 事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 22:26