So I am using localStorage on the main page to store values entered in an Aweber form (using HTML method) and then display those captured values on the next page. This setup works when I am using own local form but not with Aweber form. Script to capture the name and email from form is:
<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);
}
to retrieve value:
<script>
function load() {
var storedValue = localStorage.getItem('text');
}
</script>
I am using onclick="save()" on the button and form acting is set to https://www.aweber.com/scripts/addlead.pl
Thanks for the help
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):
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/