Home Resources Blog

Version 2 of the AJAX subscribe form is now available. You can find it here.

Adding a subscribe form to your site has always been a simple matter of pasting some supplied code from your account. Recently we’ve had more and more customers asking how they can go about turning this standard form into an AJAX based form that could submit without refreshing the page.

We’ve just put the finishing touches on a simple code sample you can use to achieve just that. The best part is, we’ve built it so you can just drop in the supplied subscribe code and you’re done. The code will also check to make sure the email address entered is valid before it processes the form. Once a submission has been made, the form will be hidden and a confirmation message shown in its place.

This example was put together using jQuery and PHP. The concept is fairly simple and the code is well commented, so it could easily be adapted to another programming language.

You can copy the code here. Feel free to modify it to suit your needs.

On a side note, this sample code was put together by David Martin, Campaign Monitor’s new designer extraordinaire. You’ll be seeing much more of Dave’s work over the coming months when we release some exciting new features he’s been hard at work on.

10 thoughts on “Creating an AJAX Subscribe Form

Comments are closed.

This blog provides general information and discussion about email marketing and related subjects. The content provided in this blog ("Content”), should not be construed as and is not intended to constitute financial, legal or tax advice. You should seek the advice of professionals prior to acting upon any information contained in the Content. All Content is provided strictly “as is” and we make no warranty or representation of any kind regarding the Content.
Straight to your inbox

Get the best email and digital marketing content delivered.

Join 250,000 in-the-know marketers and get the latest marketing tips, tactics, and news right in your inbox.

Subscribe

See why 250,000 companies worldwide love Campaign Monitor.

From Australia to Zimbabwe, and everywhere in between, companies count on Campaign Monitor for email campaigns that boost the bottom line.

Get started for free