Today I took the first steps towards publishing my newsletter and that of course means putting up a signup form. This is a dreadful, backwards process of creating a new template page, building a form, a processing script and then sending the user where they started out from. It involves unnecessary clicks, diminishes from design and flow of the site. But it doesn’t have to – enter jQuery and WordPress.
Using jQuery framework and a simple backend server script you can collect data from the user and post the response inline on the same page with the minimal interruption to the browsing process and minimal changes to the layout. For example, my form prompts users for their email address in the sidebar to the right. It communicates errors or success by fading in a container with the error or congratulations text. No page reloads, no dedicated pages to design or maintain – just embed another widget in the sidebar and enable the site to be more functional. Gotta love AJAX.
I wrote a quick and simple HowTo article on creating AJAX driven forms in WordPress: Check it out.