Django support only server side validation. Dose it support
validation on Client Side? I would like to push it on client,
to keep my server load light.
Well, through JavaScript, you can do *both* server-side and
client-side validation. However, not everybody flies with JS
enabled (speaking from experience), so it's best to not trust
anything coming from the user. A combination of FireFox's
WebDeveloper and NoScript plugins would allow me to bung with any
data I'd be sending to your server.
If you don't validate on the server, you're just asking for trouble.
But yes, you can easily serve up some JS with your HTML that will
do local validation. This will allow you to catch what your
visitors-with-JS have, saving them a round-trip to the server,
only to have it come back and tell them that they missed X.
In theory, you could emit a table (or JSON structure) that would
contain the ID of each element in your form, along with a JS
version of any associated validators. Your JS form-submission
could then spin through your form, checking each element to
ensure that it passes the JS versions its validator(s) before
actually submitting.
-tkc
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---