Form validation methods

From my experience, I already use 3 main type of method to validate a form. Purpose of form validation is to prevent spamming, injection and empty message. In addition, this will make our form more friendly, safe and interactive.


Method is use :

1. JavaScript validation.
Integrated on the form web pages, refuse the submit form if the required fields is empty or out of criteria. This will pop-up a message window. We can this, on web page validation.

2. PHP script validation.
Add-on some validation script on the PHP file which processing the form output and send the mail. Then, redirect user to the corresponding page. We can say, this is on server validation.

3. Using captcha.
This method required user to fill some validation code to continue sending the form. Now a days, there was a lot of type of captcha. You can built and customised you own captcha or use free recaptcha. E.g: Recaptcha - Stop spam. Read books. We can say, this is a complete solutions for form validation; on web page and on server validation.


Next, I'll write a simple tutorial about applying this three methods of validating  a form.
Have a nice day!

Write by Arafa Daming

Google new feature - +1 (Plus one)

Google has lunch new feature to compete Facebook Like Button named +1 (Plus One) button. This feature automatically integrated on my blog. You also can customized it's position on your blog. It also available as a WordPress Plugin.

You can view +1 button FAQ here

This is short explanation of +1 button by Google :

+1 is as simple on the rest of the web as it is on Google search. With a single click you can recommend that raincoat, news article or favorite sci-fi movie to friends, contacts and the rest of the world. The next time your connections search, they could see your +1’s directly in their search results, helping them find your recommendations when they’re most useful.

Have a try!

Write by Arafa Daming

Enabling HTML5 on Internet Explorer (IE) with javascript

Create new HTML5 elements for Internet Explorer (IE) using javascript. Save this script as a javascript(e.g: html5.js) and include in your web pages.

This script should load before any others. We want the new elements to be parsed before pretty much anything happens.

document.createElement("article");
document.createElement("aside");
document.createElement("audio");
document.createElement("canvas");
document.createElement("command");
document.createElement("datalist");
document.createElement("details");
document.createElement("embed");
document.createElement("figcaption");
document.createElement("figure");
document.createElement("footer");
document.createElement("header");
document.createElement("hgroup");
document.createElement("keygen");
document.createElement("mark");
document.createElement("meter");
document.createElement("nav");
document.createElement("output");
document.createElement("progress");
document.createElement("rp");
document.createElement("rt");
document.createElement("ruby");
document.createElement("section");
document.createElement("source");
document.createElement("summary");
document.createElement("time");
document.createElement("video");


Example :

<!--[if lt IE 9]>
<script type="text/javascript" src="js/html5.js"></script>
<link rel="stylesheet" href="css/ie.css" type="text/css" media="screen" />
<![endif]-->

This is very usefull if you want to develop a HTML5 web pages.
Have a nice day!

Write by Arafa Daming