I NEVER EVER EVER rely on Javascript only. I always build my pages with server-side validation and display very pretty error messages when form data just isn't right.
Only after that, do I ever think about putting in Javascript. In fact, the most Javascript I use is probably just to set the focus on the first form field. The other guy I work with relies almost completely on Javascript with very little server-side processing. When JS is disabled, things just really fart out on that stuff. M!ke -----Original Message----- From: Robyn [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 22, 2005 12:40 PM To: CF-Community Subject: client- or server-side, or both? Hey all, I'm wondering what you all do for validation on your webforms. If you are writing a form that has lots of fields or what have you, do you typically do javascript validation for whether required fields are filled in, etc. and then repeat that validation on the server side (in the event that the user has no JS turned on), or do you just make sure that the user has JS turned on and do client-side for some, and do server-side appropriate validation for things like database dependent validation, etc.? You might be saying - it completely depends on the requirements/the app/ the environment, etc. True! But what I'm trying to get at is this: If you had an app that required Javascript to work at all (DHTML stuff that made things go, for instance), then do you just make sure that the user has it turned on and rely on your JS validation for input validation, or do you also protect against, say, some hacker posting a spoofed form to your submit page, too, and thus go through ALL the same validation on the back end? I know that it's best for security to do all validation server-side, and if you do client-side, then to repeat it on the server. But what do you all do in real-life? And if you do the "right" thing, what have you done that has made your life easier? -Robyn ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Sams Teach Yourself Regular Expressions in 10 Minutes by Ben Forta http://www.houseoffusion.com/banners/view.cfm?bannerid=40 Message: http://www.houseoffusion.com/lists.cfm/link=i:5:151296 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/5 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:5 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.5 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
