posted 11 years ago
1. Because sometimes people turn JavaScript off, for one reason or another. Including dire Microsoft security alerts about the latest JavaScript-related exploit.
2. Because trusting the client to provide sane data is insane. A considerable percentage of security exploits work because someone has hacked the client-side processing to return unexpected data in the hopes of breaking the server.
Use JavaScript to provide a faster user feedback. Use server-side validation to protect yourself. If you're using JavaScript as your first line of defense, you won't have to pay the server validation overhead until all client-side edits have permitted the server request to go through. And at that point, the "network traffic" is the data being updated, so there's no real penalty.
The one penalty you do pay of course, is in whatever work you do to duplicate the validation, But that extra investment in robustness is what separates the "toy" programs from enterprise-grade applications and why the hypothetical 10-year old kid isn't the equivalent of a trained software developer.
Of course, if you use a JSF tagset that can automatically generate both the client- and server-side validations from the same specifications, I won't stop you. In fact, I'm always on the lookout for tools of that type.
Sometimes the only way things ever got fixed is because people became uncomfortable.