Re: jquery, json and forms
It sounds like you want to initialize your form in the view. You can also do this by passing an initial keyword argument to the form constructor:
exampleform = ExampleForm(initial={"examplefield": request.user.first_name})
This would set the examplefield of ExampleForm to the requesting user's first name.
On Monday, 2 July 2012 11:12:49 UTC-4, David wrote:
Hello--I have a form that saves, and displays errors correctly when using javascript and without.However, when my form saves I need to refresh the form with the new form data. How can I pass the form object through json back to my template please?Thank you for any help.
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/hwbSMtCqzcUJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home