Pages

Monday, 16 January 2012

Building Your Own Contact Forms

I'm more of a designer than a developer, and have been struggling with my latest project: adding a PHP web form that submits product orders as well as people's names and email addresses. I even went on a forum to ask for help, but so far I haven't got the results I want because I either end up wiping out my response mailer form or getting only half the information. However, after a determined search, I've found the best possible solution to the problem - till I get the information I was after in the first place.


The problem:


Picture the scene: you've diligently followed the instructions on the tutorials for building your web form. You've added radio buttons and checkboxes to the same basic script you use for your contact mailer. Well, that works, doesn't it?


Yeah, but checkboxes and radio buttons are tricky things. They've got to be properly connected to the mailer response file, and if they're not, they won't work. If you mess up your code, you'll be stuck with the dreaded blank white page. You're getting annoyed.


There are a few options open to you at this point: look for a tutorial that makes it a bit clearer (or flat out gives you the code you need that you can alter to suit your needs), go on a developers' forum, or look for an online form builder.


Online assistance


Assistance at forums is patchy at best. It doesn't help that most of the users appear to be enthusiastic amateurs helping each other out as best they can. Sometimes you have to bump your thread to get a response.


The thing is, you can get away with the odd mistake in HTML because the worst that can happen is that your page looks wonky or you fail the validation check at W3C. It's usually easy to correct and the tutorials are blessedly clear. However, PHP errors are nearly always fatal. It's just a matter of degrees, so if the friendly, helpful fellow at the other end slips up, you either get a form that doesn't do what you want or the dreaded blank white page. Neither of these is a desirable situation, so that's why I went looking for an online generator.


Generators


There are quite a few of these, and most of them fell flat when I went to try them out. The first one I tried was a downloadable affair that you upload to your webhost. The idea is, you end up with your own online area for building forms on. The idea seems ridiculous to me because I want it for myself, not to share as an altruistic gesture. Besides, it's hard to customize and doesn't work. So much for the "professional-looking" forms I was promised!


I tried some online forms that store your data on their websites. Ostensibly free, they are usually hard to customize and simply must advertise themselves distinctly - while taking your reader away from your site and on to theirs. If that's not bad enough, they don't have all the options you want. And they cost if you start to get any number of people using them.


At the point of giving up, I had one last look for a decent one and discovered Jotform.com.


Jotform


At first, I found it a bit frustrating to use because I wanted to break up some of the form fields, but that's because I didn't get it: once you get the embed source code, you can do what you like with it. You're not stuck with the layout at all. Now that's my idea of a decent script!


Another thing that pleased me greatly was the PayPal integration. Everyone else was charging for that, but they do it for free. It's not going to cost me till I go over my limit for a free account.


What happens is, when you go to buy a product, it takes your details, then sends you to PayPal to pay the bill. I was planning to send PayPal invoices to people who ordered stuff from me, so this is better - and a whole lot neater.


SEO Social Media


It's all been in aid of the new service I'm offering, SEO Social Media. The idea is, I'll set up and customize accounts for you on Facebook, Linked In, Twitter, Qype and Meengle, then integrate them so that every time you post on your blog or post a tweet on Twitter, your accounts receive a link to that tweet. I use Networked Blogs to automate tweeting/updating on Facebook and Twitter, and have Twitter linked to my accounts on the other social media.


I've got accounts with Google Checkout and PayPal. I was looking into incorporating PayPal functionality into my website to make it easy to receive payments, but realised that, whatever I came up with would need to integrate properly with the order form. Jotform has completely, neatly and elegantly solved the problem. Their customizable forms make it easy to add the information I want to collect, and when I've got the source code I can customize it further in Kompozer till it's perfect.


Conclusion


I'm still hoping to get the correct answer to my PHP coding question on that forum so I can apply it - and have more options for use on design projects. Meanwhile, I'm very pleased with Jotform and hope to receive some submissions from it soon.

No comments:

Post a Comment