Here is a handy piece of JavaScript code that you can use on your email capture forms to automatically Capitalize the first letter of each word entered into the Name field and also validate that the user entered a correctly formatted email address. It also cookies the data entered into the form so if they come back to your squeeze page or another form on your site, their details will automatically be filled in. You can use this code with any autoresponder service and any form code. I use this mainly with aweber and getresponse.
Here’s the benefits of using this javascript:
1. – The validation happens before the user leaves your squeeze page. If your site visitor enters an incorrect email address and clicks the submit button, they will get a popup error asking them to input a valid email email address. This is a much better solution than having them be redirected to a default aweber or getresponse error page. If that happens, you lose continuity with the site visitor as they see someone else’s site colours and page layout and they may just not bother to go back and fill in their correct details. That’s an easy way to lose signups… You don’t want that to happen.
2. – It’s nice having correctly formatted name info in your autoresponder system… It’s clean and when you put Hi {firstname}, into your autoresponder message you know that it is going to be formatted correctly. It’s also really cool seeing the first letter of each word automatically capitalize when you tab out of the name field. Try it in the form below, enter something like “joHnNY sImpsON” into the form below and tab to the next field… How cool is it? You could do that all day right?
3. – Their info is stored in a cookie on submit. This is handy if you are sending your visitors through a sequence that requires duplicate information. You’re going to increase your conversion rate if your visitors don’t have to keep filling in their name and email address on subsequent pages. Think about this… What if you just grabbed a visitors email on your first signup page. Higher opt-in rate right? Then on the second page you asked for more info and used the cookied email address to auto fill in a hidden field. You’ve got 2 advantages there… They have already said “yes” to your initial offer, so they are committed. They are more likely to fill in information on the second page, and even if they aren’t willing to give you any info on the second page, you’ve still got their email address in your autoresponder so you can build the relationship from there and later send them to the second page. Here’s another cool advantage – If you have multiple forms for different autoresponder sequences on your site, everytime the visitor comes back, their info will be pre-filled for them.
Here’s an example of this bad boy in action. I’ve put this in an iframe to make it easier to view the source (if you’re into that kinda thing). This is a real offer by the way… If you put your name and email address in there I will actually send you my underground method for ranking on the first page of google.
[iframe http://www.easiestaffiliatewebsite.com/javascriptoptin.php 100% 900]
Here’s the magic code that makes this possible: (Put this at the bottom of your page just before the closing < /body > tag
And here's what the form code looks like:
The important part to take note of, if you are using this with a service other than getresponse is the fieldname part of the javacript.
var FieldName = "subscriber_name";
Other services may require the name of the input fields to be different
You'll also notice the php code I use in this form to give me the exact page that a user signed up from.
= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];