Am 17.11.2005 um 23:29 schrieb Antonio Cavedoni:
On 17 Nov 2005, at 11:51, Christopher Lenz wrote:
While there are definitely many types of validations that can't be
performed on the client side, calling back to the server just to
check whether e.g. a text-input is empty is overkill IMO. The same
goes for validity checks for common things like text fields
expecting an email address or date.
I'd prefer a hybrid approach, where simple javascript validation
checks are generated, and the others are performed via AJAX
callbacks.
I don’t agree with this approach. While I think client-side
validation is fine and dandy, and from a user perspective is
definitely the way to go, we cannot rely on it.
Well, it goes without saying that server-side validation is *always*
required. AJAX or not.
We also don’t want to have to mantain the same code in two places:
email-validation in JS on the client and email-validation on the
server (yes, I’m oversimplifying, but you get the idea).
I don't agree, at least for the common cases such as validating
emails, URLs, date/time fields etc. It really shouldn't be necessary
to call back to the server for trivial and/or common validation tasks.
Cheers,
Chris
--
Christopher Lenz
cmlenz at gmx.de
http://www.cmlenz.net/