Custom AJAX subscribe form for PHPlist

Advanced Questions & Problems

Custom AJAX subscribe form for PHPlist

Postby borsodas » 4:03am, Wed 13 Jul, 2011

I am trying to create an AJAX login form for PHP list, I have a working form that works fine in without AJAX, but not with. the catch is that the success message from the JQuery AJAX call is fired, so I am getting something back from the server.

I used some code that I found on this post
viewtopic.php?f=15&t=24128

The question I have for the PHPlist community is, where do I find the php file that generages the /lists/?p=subscribe page. This way I can begin to find out why I am getting a success message without the signup being completed.





my code

Code: Select all

<form id="newsletter" action="http://www.officeyoganyc.com/lists/?p=subscribe"  method=post name="subscribeform"><input type="hidden" name="formtoken" value="a7d1884b463ed70e91fb62a5121e9846" />


<div class="fieldHolder">
  <div class="attributeinput1"><input type=text name=email value="email" size="12"/>
  <script language="Javascript" type="text/javascript">addFieldToCheck("email","Email");</script></div>
  </div>


  <div class="fieldHolder2">
  <div class="attributeinput2"><input type=text name=emailconfirm value="confirm email" size="12"/>
  <script language="Javascript" type="text/javascript">addFieldToCheck("emailconfirm","Confirm your email address");</script></div>
        </div>
  <input type="hidden" name="list[1]" value="signup"><input type="hidden" name="listname[1]" value="office yoga list"/><div style="display:none"><input type="text" name="VerificationCodeX" value="" size="20"></div>

<div id="subscribe"><input type=image src="http://www.officeyoganyc.com/themes/zen/zen/images/yogaSubmit.png" id="go" name="subscribe" value="Subscribe" onClick="return checkform();"></div>
    </form>


  <script type="text/javascript">
        $(document).ready(function () {
            $('#go').click(function () {
                $.ajax({
                    type: 'POST',
                    data: $('#newsletter').serialize(),
                    url: $('#newsletter').attr('action'),
                    success: function (msg) {
                        $('#eee').html(msg);
                        alert('Thank you for your registration. Please check your email to confirm.');
                    }
                })


                return false;
            });

        });
    </script>
borsodas
phpLister
 
Posts: 8
Joined: 3:39pm, Sat 23 Apr, 2011

Return to Advanced Questions & Problems

Who is online

Users browsing this forum: No registered users and 2 guests