Hello everyone,

first post on the list, I’ll be introducing myself at the bottom of this message.

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.

It’s not like we’re in 1999 when we could develop a “DHTML”- cool-whiz-bang inaccessible piece of crap and still expect to get along with it. We’re in 2005, and we *know* that some people turn JS off on purpose, use browsers where JS support sucks, or are disabled and we cannot feed them some of the “dynamic” stuff we think is so cool, because they just won’t be able to use it.

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).

So I think the best way for Django, “the web framework for perfectionists with deadlines” is to do The Right Thing™ and have some sort of support for dynamic, JS-based form validation on the client powered by the same logic that powers the server-side, and this is where JS libraries and “AJAX” interactions fit in, IMHO.

Bottom line: JS/AJAX stuff, yes but only if it’s done right, which means accessible and done in a context of progressive enhancement.

What do you guys think?
--
Antonio

About me: I’ve been hacking with Django for some weeks now, I’ve been developing websites for almost 8 years now and I used to code in PHP/JS/ActionScript/XSLT. I’ve been moving to Python for the last year and a half and Django was a godsend in that regard. My first and only contribution to the project so far has been this rather outdated guide to get Django on OS X:

 http://cavedoni.com/2005/django-osx

I had also planned to contribute the code to produce Atom feeds from the syndication framework, but somebody beat me to it by a couple of days (damn!).

Reply via email to