<html>
<head>
<title>テスト</title>
<script>
var child = null;
function closeChild() {
if(child && !child.closed) {
child.close();
}
}
</script>
</head>
<body>
<form method="post" action="http://hoge/foo/bae" target="foo" onsubmit="child = window.open('', this.target)">
<input type="submit" value="開く" />
<input type="button" value="閉じる" onclick="closeChild()" />
</form>
</body>
</html>