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
Thanks John, that looks really promising and could be exactly what I
was asking for. I have to admit to still being so new to django that I
haven't played with templatetags or filters yet, so this is good
motivation to do more homework.
On Jul 8, 9:52 pm, "John Shaffer" <[EMAIL PROTECTED]>
On 7/8/07, James Bennett <[EMAIL PROTECTED]> wrote:
> Well, the thing to remember is that you're not just displaying an
> empty input element -- it's fairly common, due to the data validation
> step, to have to go back and show the form again with values filled
> in.
Right, so use:
It gets
Ok, so here's what I get when I pinged this discussion to the two
python guys I work with: basically, you want to be able to redisplay
the data the user entered on a form when you return the page with
errors. And that the newform shortcuts are the only way to do that.
If that's the case, then
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?
James,
On 7/8/07, Al Abut <[EMAIL PROTECTED]> wrote:
> Does using a newform shortcut make things that much easier from a
> programmatic standpoint? Or to ask the opposite, is using and
> elements in a template make things that much harder for
> things like data validation?
Well, the thing to remember
> All that the shortcut does is give you less to type. It doesn't affect
> validation at all. As long as you have a form element with the same
> name, validation will work fine.
Ok, thanks John, I'm calling out the developers at work and pointing
them to this :)
I use jQuery as a base for my JS, so it becomes pretty simple to
attach the events. I personally don't like putting JS into the HTML
element inline, though, so I'm bias. But I basically just add a script
element to my form page:
$(function() {
On 7/8/07, Al Abut <[EMAIL PROTECTED]> wrote:
> Does using a newform shortcut make things that much easier from a
> programmatic standpoint? Or to ask the opposite, is using and
> elements in a template make things that much harder for
> things like data validation?
All that the shortcut does
Ix5 - thanks for the link, being able to tack classes into the form
elements as they're being autogenerated would help but that method
looks like a pretty convoluted way to just tack on some presentation-
related info, no? Compared to if that element was plain html, that's
the standard I'm
A reply by John Shaffer posted on django-developers (didn't realize it
was for "developing django" not "developing with django"):
"We use this in Satchmo:
Discounts
Discount code
{{
form.discount }}
{% if form.discount.errors %}*** {{
form.discount.errors|join:", " }}{% endif
Maybe it will be useful:
http://groups.google.com/group/django-users/browse_thread/thread/a60038f4d0777391/a94a8e1dff4865db#a94a8e1dff4865db
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
of the templates.
Can anyone share their tips on ongoing work with forms and designers?
I asked a particularly well-known web designer on a django team how
they deal with the issue and his answer in short is that they don't:
he creates all the html by hand, including any form elements. Since I
imagine
13 matches
Mail list logo