Filed under: Web Design, Technology, PHP, Javascript — Lee on Tuesday, October 11th, 2011 @ 6:06 pm

In web development, form validation is undeniably a crucial asset to avoid errors when submitting data to a database. Sounds like a tedious job you say? Enter jQuery, one of the most useful and intuitive web tools of the last decade which takes what is potentially hours of writing javascript and turns it into just a few lines of code.

Similar to the way that most Apple products have “an app for that”, jQuery usually has a plugin for any otherwise time-consuming task. The tool, designed to simplify client-side scripting in HTML, and it does the job to a standard far above expected.

Client-side validation certainly has it’s advantages. Not only does it dramatically reduce unnecessary trips back and forth to the server, it can also improve the user’s experience visually when completing a form on the web. With jQuery validation, we can create an extra class which is to be applied to form fields whose data entered is incorrect, so when we add the script, the user is prompted to fill in the form correctly before any call is made to the server.

Form validation can also be implemented using PHP. It is advisable to remember that not everybody browsing the web will have javascript enabled so it is still highly recommended to use some server side validation alongside jQuery to ensure that any data is submitted correctly. As jQuery is client-side and PHP is server-side, the jQuery will always run first so users with javascript enabled will save pointless round trips to the server.

As the Not Web Design newbie, I see jQuery as a tool which has been a catalyst in my learning process so far and I am sure I will enjoy learning how to use more of it’s plugins in the future.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]