0

所以我在主页上使用 localStorage 来存储在 Aweber 表单中输入的值(使用 HTML 方法),然后在下一页上显示这些捕获的值。当我使用自己的本地表单但不适用于 Aweber 表单时,此设置有效。 从表单中捕获名称和电子邮件的脚本是:

<script>
localStorage.clear();

function save() {
    var username = document.getElementById('awf_field-95821347').value;
    localStorage.setItem('username', username);
    var username = document.getElementById('awf_field-95821348').value;
    localStorage.setItem('useremail', username);
}

检索值:

<script>
    function load() {
      var storedValue = localStorage.getItem('text');
    }
</script>

我在按钮上使用 onclick="save()" 并且表单代理设置为https://www.aweber.com/scripts/addlead.pl

谢谢您的帮助

4

1 回答 1

0

You should be able to save the values first then submit the form after, as long as you are not sending the form info from a script. The form method must be "post" and the action must be that "https://www.aweber.com/scripts/addlead.pl". If you're sending anything else to the addlead.pl url or submitting values in any other way it'll be blocked by AWeber. This is described here: https://help.aweber.com/hc/en-us/articles/204027896-Can-I-use-my-own-form-

Without actually seeing the form it's a bit hard to tell what could be going wrong, but it sounds like if you're using the submit button to both save the info to local storage and submit the form then AWeber's protection against bots and scripting might be blocking your form submission as well. Generally there should only be a single submit button on an HTML form that submits to addlead.pl and does nothing else.

You can actually pass values to the thank you page/redirect page in AWeber, but you'll need to make sure your form passes those on to your thank you page by adding the following to your form (this is also in the "Can I use my own form?" link above):

<input type="hidden" name="meta_forward_vars" value="1" />

That can be added via the sign up form generator as well as described here: https://help.aweber.com/hc/en-us/articles/204027936-How-Do-I-Pass-Form-Data-to-My-Thank-You-Pages-

Once that value is set in your form, the values will be passed to your thank you page in a query string. From there, you can process the values on your page however you like. There's an example in JavaScript here: https://help.aweber.com/hc/en-us/articles/204027506-How-do-I-display-subscriber-information-on-my-Thank-You-page-

If you'd like to submit addresses using a script, I suggest checking out AWeber's public API as it'll give you a bit more flexibility. https://labs.aweber.com/

于 2018-02-20T16:35:37.480 回答