Maybe because you actually have to pass `action`? ;)

Pass it through your form. Maybe my use of 'action' confused you with the
<form>'s action property. Not what I meant, sorry.

I didn't realize you had an actual form (Wait, why do you .. Ok, beyond the
point) but in this case you can just check for any value within your form
and see if it's True
If your form has a "name" field you could do: if request.GET.get('name'):
...

Your initial problem is when you load a page, that Is a GET request so
that's why it was going through.





On Fri, Jun 13, 2008 at 10:45 PM, ichbindev <[EMAIL PROTECTED]> wrote:

>
> This is what my template looks like:
>
> <form action="." method="GET"><table>{{ form.as_table }} </
> table><input type="submit" value="submit"></form>
>
> This is what my view looks like:
>
> ...
> myform = MyForm()
> if request.method=="GET":
>        myform = MyForm(request.GET)
> if request.GET.get('action') == True:
>         if myform.is_valid():
>        ...
> ...
> return render_to_response ('template.html', {'form' : myform})
>
> When I first go to the page, requet.GET.get('action') is None. When I
> click the 'submit' button, again requet.GET.get('action') is None. I
> used HttpResponse to return requet.GET.get('action') as a string.
> >
>

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