Why most sites rarely use javascript to validate form input?

Javascript coding ..

Moderators: macek, egami, gesf

makarakao
New php-forum User
New php-forum User
Posts: 51
Joined: Wed Aug 24, 2005 2:10 am
Contact:

Why most sites rarely use javascript to validate form input?

Postby makarakao » Tue Sep 05, 2006 9:01 pm

Hi there!

I wonder why most sites rarely use javascript to validate form input. I usually see them validate the input during the server-side process. Are there any reasons that most sites do this? In my site, I usually validate the form input during the client-side process (I mean check the valid email address, empty input, etc. using javascript). Are there any disadvantages if I do it like this?

Hope someone could give me some ideas about this.
Thank in advance.

Makara Kao

User avatar
AeroX
New php-forum User
New php-forum User
Posts: 142
Joined: Sun May 11, 2008 1:40 am
Location: London, UK
Contact:

Re: Why most sites rarely use javascript to validate form input?

Postby AeroX » Fri Jun 06, 2008 12:15 am

The vistor may have javascript disabled or a browser which doen't suport javascript. Javascript can be manipulated by anyone with knowledge of how it works.
Different browsers run javascript differently. Some javascript functions in one browser are not their in the other browsers.

The best way it to use both client & server side validation. That way the javascript can try to help the user enter the data correctly the first time but if they don't have javascript then the server will correct it.


Return to “JavaScript”

Who is online

Users browsing this forum: No registered users and 1 guest