0

I'm calling a Mautic form using its token instead of a manual copy.

{form = 5}

When the form is submitted, the button text temporarily changes to "Please wait ...".
However, I need it to be a different text.

If I implement the form by manual copy, I could modify this message just by declaring this variable.

var MauticLang = {
  'submittingMessage': "Another text"
}

I tried this in a script within the HTML where the form is, after and before it, also after the DOM is loaded, but there was no effect. I investigated the code on the page as much as I could, but to no avail. I have researched, but can't find a solution anywhere.

How to change the button sending message after the form is already loaded?

4

1 回答 1

0

修改submittingMessage值是要走的路。

MauticLang.submittingMessage = "Hold your horses...";

或者

MauticLang = {
  'submittingMessage': "Hold your horses..."
}

此外,为确保在加载 Mautic 后对其进行修改,您可以在 window.loadsetTimeOut事件侦听器上使用。

大约 5 秒,足够让用户填写表格的时间。
因此,最终的解决方案可能是:

window.addEventListener('load', function() {
  setTimeout(function() {
    MauticLang.submittingMessage = "Hold your horses..";
  }, 5000);
});
于 2020-03-31T18:52:31.190 回答