Solved

Form input validation

Posted on 2003-12-08
5
197 Views
Last Modified: 2010-04-06
A general question I would like to ask is that when we create web-based applications what sort of validations do you think is better?

What I mean is that should the validation be checked on the client side (using JavaScript?) or on the server side.
One of my colleagues argued that validating on the client side is better than on server side, because you don?t want to overload the server. However I said that you cannot rely on the client as you in some cases might not know your audience and your validation may fail, also JavaScript sometimes causes a lot of problems.

So I would like your comments on whether to validate inputs on the client side or server side.

ps. sites like EE, Yahoo, Hotmail they all do validations on the server side (plus point I think :))
0
Comment
Question by:glottis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 17

Accepted Solution

by:
dorward earned 20 total points
ID: 9902488
If you need data intergrety then the server is the only option. Anything done client side can be overridden by the user.

So use server side first, then consider saving bandwidth for you and the visitor by putting client side in as a secondary layer.
0
 
LVL 2

Author Comment

by:glottis
ID: 9902511
will wait for some more comments
0
 
LVL 8

Assisted Solution

by:nishikanth
nishikanth earned 20 total points
ID: 9902520
its better to the the validation on server side since the client side may feel if they have the disabled them.


http://www.asptechniques.com/content.asp?a=co&cID=949
0
 
LVL 2

Assisted Solution

by:kmalhotra
kmalhotra earned 20 total points
ID: 9904776
We usually find that a combination of client side and server side validations are the best. Somethings are checked on the client side and some on the server and some on both. The logic is that a client can disable the client scripting and bypass the validations so check them on the server.

But if the client-side scripting does work, then we know that we will save a round-trip.

Thanks
KM
0
 
LVL 2

Author Comment

by:glottis
ID: 9910532
thanks for the answer
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question