Stephen
Stephen

Reputation: 6339

Check for a hidden form variable in a view

I have several forms each having a hidden field that identifies this form...I want to check for this field in my view then based on the result determine which form will be processed. How should i go about this?

Upvotes: 0

Views: 127

Answers (2)

f4nt
f4nt

Reputation: 2671

As long as the data is passed to the view in the post you should be able to grab it:

if request.method == "POST":
    if "hidden_field_name" in request.POST:
        ## do something

Upvotes: 0

geowa4
geowa4

Reputation: 41853

You should be using Django Forms. They are very powerful and quite extensible.

Upvotes: 3

Related Questions