The Best Web Design Tips Blog



Form Validation

Javascript validation, can be one of the most useful tools for your website, but it could also be the tool for a hacker to take your site down. There are few ways that web-designer validate forms. First there is client side validation which takes place on the user machine. (Javascript) Then there is server side validation, which obviously takes place on the server. (cgi-scripting, php, asp, or some other server side scripting). Then the last way is to combine the two and use both client and server validation. What's the point to use both though?

First the bad news, client side validation leaves your server open to hacking attempts. The source can easily be downloaded, then the hacker removes the javascript, saves the file, opens it on his/her machine, and submits the form with no validation. With a few simple commands the hacker can tear apart your website. Secondly, not everyone uses javascript, some browsers don't even support it. But we don't want to tell these users that they can't user our web page.

Now the good news, (No I didn't save a bunch of money on my car insurance) javascript validation can make the web a friendlier place. If a user had to submit information to the server only for it to send it right back saying, you mistyped your password, or your emails don't match. This can lead to users not filling out the form, and bouncing off your web page. The best way to inform the user is when they input content. Using the onchange property you can quickly alert, show text, or some how notify the user that they have made a mistake.A designer can take both client side validation, and server side validation and put them together. This gives users, the convience to make sure the information is correct before submitting the data. It also gives the designer peace of mind knowing that a user can not bypass the validation.


Link to This Page: