Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7063717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:44:48+00:00 2026-05-28T04:44:48+00:00

I have been reading through lots of Q&A everywhere and these stackoverflow posts seem

  • 0

I have been reading through lots of Q&A everywhere and these stackoverflow posts seem to be most related to what I am trying to do:
1) How we can save data on two servers using one sumit form?
2) How to call server side action method just before submitting form to 3rd party url?

Basically, I am working with Aweber autoresponder service and I have been having some technical trouble where the leads don’t seem to record in Aweber even though I see on my analytics software people are filling in the forms with emails and hitting the submit button.

So, I was hoping I can and capture the form data on my server first in a TXT file, before the form data gets submitted to Aweber.

(from my research I need ajax, jquery to achieve this)

Following different posts and tutorials, I have come up with the following but unfortunately is still not working…

Please let me know how to fix this code if possible. THANK YOU so MUCH!!!

Head with jquery:

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>

<script type="text/javascript">

$(document).ready(function() {

    //if submit button is clicked
    $('#submit').submit(function () {       

        //Get the data from all the fields
        var email = $('input[name=email]');
        var custom_sub1 = $('input[name=custom sub1]');
        var custom_sub2 = $('input[name=custom sub2]');
        var custom_sub3 = $('input[name=custom sub3]');

        //organize the data properly
        var data = 'email=' + email.val() + '&custom_sub1=' + custom_sub1.val() + '&custom_sub2='
        + custom_sub2.val() + '&custom_sub3='  + custom_sub3.val();

        //start the ajax
        $.ajax({
            //this is the php file that processes the data and send mail
            url: "http://mydomain.com/form_plus_email.php",

            //method
            type: 'POST',

            //pass the data        
            data: data,    

            //Do not cache the page
            cache: false,

        success: function() {
            }
        });



        //cancel the submit button default behaviours
        return false;
    });
}); 


</script>
</head>

The above, I don’t know if “return false;” is causing the problems

Body with form:

<form method="post" action="http://www.aweber.com/scripts/addlead.pl">

<input type="text" name="email" value="Enter email" id="email">

<input value="xxxxxxxxxxxx" name="meta_web_form_id" type="hidden">
<input value="" name="meta_split_id" type="hidden">
<input value="xxxxxxxxxxxxx" name="listname" type="hidden">
<input value="http://domain.com/thankyoupage" name="redirect" type="hidden">
<input value="http://domain.com/thankyoupage" name="meta_redirect_onlist" type="hidden">
<input value="xxxxxxxxxxxxx" name="meta_adtracking" type="hidden">
<input value="1" name="meta_message" type="hidden">
<input value="email" name="meta_required" type="hidden">
<input value="1" name="meta_forward_vars" type="hidden">
<input value="" name="meta_tooltip" type="hidden">
<script type="text/javascript">
{
document.write('<input type="hidden" name="custom sub1" value="'+sub1+'">')
document.write('<input type="hidden" name="custom sub2" value="'+sub2+'">')
document.write('<input type="hidden" name="custom sub3" value="'+sub3+'">')
}
</script>

<input type="image" value="Submit Button" name="submit" src="image.png" id="submit" class="button1">
        </form>



</body>

For Aweber, it is important all the fields listed both hidden and not hidden to be passed on to the action=”http://www.aweber.com/scripts/addlead.pl&#8221;.

However, for myself, as I am only interested in 4 fields, I have specify all that I need in the jquery section in the head tag.

I don’t know why the code isn’t working… So, how do I make sure it will save to my server first with ajax before the form data is submitted to 3rd party url? Right now…

<form method="post" action="http://www.aweber.com/scripts/addlead.pl">

is executing and working properly… but the ajax does not save the data at all from what i can tell

Thank you so much!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:44:48+00:00Added an answer on May 28, 2026 at 4:44 am

    First change the event on the submit button you use. So instead of

    $('#submit').submit(function () {
    

    use

    $('#submit').click(function () {
    

    as the submit event is for the form, not the button. Once you’ve changed that, then as Ramengo mentioned, use your success function to submit the form.

    Better would be though be to use the Aweber API which allows you to add users to an account since November 2011.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been reading through a few articles on PDO and they seem to
So I've been reading through the K&R C book and have a question.. in
I can’t really understand how YouTube serves videos, but I have been reading through
I have been reading lots of posts and am confused as to why this
I have been reading through Intuit's new IPP Federated App documentation. I am trying
I have been reading through the C++ FAQ and was curious about the friend
I have been reading through the CodePlex supported open source licenses, i couldn't quite
I have been reading through this wonderful website regarding the recommended Python IDEs and
I have been reading through the documentation on the JavaScriptMVC framework and it looks
I have been reading the proper article in MSDN, Strong-Named Assemblies and a related

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.