views:

76

answers:

1

I'm building a page where I want to have a form that posts to an iframe on the same page. The Template looks like this:

    <form action="form-results" method="post" target="resultspane" >
        {% csrf_token %}
        <input name="query">
        <input type=submit>
    </form>

    <iframe src="form-results" name="resultspane" width="100%" height="70%">
    </iframe>

The view behind form-results is getting CSRF errors. Is there something special needed for cross-frame posting?

+2  A: 

Actually, the problem has nothing to do with cross-form POSTing. The template that displays the form needs to be rendered with RequestContext as in

return render_to_response('form_template.html',
        context_instance = RequestContext(request))
Leopd