On Jul 8, 8:36 pm, Al Abut <[EMAIL PROTECTED]> wrote:
> Nathan, thanks for those tips and that looks like a smart way to
> attach js triggers and classes for css. What about all the other stuff
> I could do to an html element though, like specify its initial value?
> Or do I draw the line there as a designer and say that's on the
> programmer's plate?
I would definitely leave this to the programmer. Values are retrieved
by, supplied by, and validated by the programmer. Let them deliver it,
too.
> Not that I don't care about highlighting errors after the validation
> step - one method we've been using is to modify the text of the
> associated <label/> and give it a class="error" for me to style up
> with red text and hazard icons and whatnot.
I've found this structure to be pretty straightforward and flexible
for styling:
<form>
<fieldset class="some_fieldset">
<div class="some_field {{ form.some_field.field.required|
yesno:"required," }} {{ form.some_field.errors|length_is:0|
yesno:",errors" }}">
<label for="id_some_field">{{ form.some_field.label }}:</label>
<span>{{ form.some_field }}</span>
{{ form.some_field.errors }}
</div>
... more fields ...
</fieldset>
... more fieldsets ...
<div class="submit"><input type="submit" /> or <a href="">cancel</
a></div>
</form>
----
Nathan Ostgard
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---