On Sep 25, 9:36 am, "I.K." <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've spent a short while reading the documentation but not spotted
> what I need. Could somebody point me to the right place please?
>
> Is there a way to put a bound  Django form into a template to render
> an HTML form with the previously posted values in it?  I'd like to get
> the field value specifically, as I introduce javascript handlers on
> some fields and don't want django to render the whole field.
>
> For example, a user fills in an html form with their address but
> leaves out a mandatory field, after validation I wish to render the
> same HTML with all of the previously submitted values in the form.
>
> Thanks in advance

I'm not really sure what you're asking here - at first you say you
don't want Django to render the form, then you say you want it
completely rendered.

Assuming all you want is to redisplay a partially filled form that
failed validation along with all the entered values, that's actually
the standard way to handle forms in Django. See here:
http://docs.djangoproject.com/en/dev/topics/forms/#using-a-form-in-a-view
On a POST, the form is bound to the data, and if it is not valid, the
bound form is redisplayed.

Does that answer your question?

--
DR.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to