views:

51

answers:

1

Out of an "old" tab, i'm opening a new tab in my django-powered web-app.

Now, when submitting something in the new tab, it will still load in the old tab, however i want django to do all the stuff in the new tab/window (unfortunately, this also applies to popup-windows (popupwindow = new tab).

How can i tell Django in which window it should "do stuff"? already tried things with JS (onclick="self.focus();") and things like "target="_self" "or other things, but i think it's a django problem.

+1  A: 

This is not a django issue; which browser are you using ?

html form have a target attribute that is used as a 'reference' to another window. if the window doesnt exists, its opened.

Except for _top (top frame), _parent (parent frame) and _self (current frame)

jujule
i'm using the latest version of Firefox. Maybe the problem is, that i'm using a button: <input style="width: 120px;" type="submit" value="search" />can i assign a target to a button? i already tried target="_self", but it didn't show any effect.
ptikobj
button dont handle target. but the parent form element do. But by default its _self (except if you have <base target="xx"> in your head i guess).
jujule
thanks, i set the form target to "_self" and now it works.Didn't know that the form was responsible for the target, but makes sense.
ptikobj