I have a form with the following fields (all required):
- first_name
- last_name
- site_id
I'd like to use a template to display only the FIRST two items to the
user for him to fill out:
<form action="{% url profiles_create_profile %}" method="POST">
{{ form.first_name }} <br/>
{{ form.last_name }} <br/>
<input type="submit" value="Submit" />
</form>
Then when it gets posted back to me I'd like to set the site_id based
on a session variable or whatever like this (from my view):
if request.method == 'POST':
my_data = {'site_id':1234}
my_data.update(request.POST)
form = form_class(data=my_data, files=request.FILES)
if form.is_valid():
process form here...
My problem is that I cannot get the form to validate. It keeps telling
me that site_id is not set.
How can I programmatically set this one form field's value and have
the user set the others without sending through a hidden field yada
yada.
Please help!
Thank you.
Keyton
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---