[prog] JavaScript question: submitting a form to a new Window in IE 5.5

Mary mary-linuxchix at puzzling.org
Fri Oct 7 10:35:13 EST 2005


On Fri, Oct 07, 2005, Mary wrote:
> I will double check at work today, but I think we've tried this already,
> and... it doesn't work. It exhibits the same behaviour as described
> previously. It works on IE 6, but so does my original example. They seem
> to have pretty different behaviour for this kind of problem.

Neither of the following work on IE 5.5:

<html>
<head>
  <script type="text/javascript">
  <!--
  function submit_form() {
    window.open('', 'foo', 'width=450,height=300,status=yes');
    document.myform.submit();
  }
  // -->
  </script>
</head>

<body>

<form name="myform" action="" target="foo">
<input name="q">
<button type="button" onclick="submit_form()"> Submit</button>
</form>

</body>
</html>

or, making sure that the onclick task returns false:

<html>
<head>
  <script type="text/javascript">
  <!--
  function submit_form() {
    window.open('', 'foo', 'width=450,height=300,status=yes');
    document.myform.submit();
  }
  // -->
  </script>
</head>

<body>

<form name="myform" action="" target="foo">
<input name="q">
<button type="button" onclick="submit_form(); return false;">
Submit</button>
</form>

</body>
</html>

Both of these have the same behaviour as that described in my initial
mail. (Note that all three variations work on IE 6.)

-Mary


More information about the Programming mailing list