Hi everyone.

I have problem with this function javascript:

Code:
var popup = null;
 
function OpenPopup(fld, tbl, col, w, h)
{
  var pw = Math.floor((screen.width - w) / 2);
  var ph = Math.floor((screen.height - h) / 2);
 
  if (!popup || popup.closed) popup = window.open

("popUp.htm?f=" + fld + "&t=" + tbl + "&c=" + col, "sel",
              "width=" + w + ",height=" + h + ", top=" + ph + ",left=" + pw);
 
  if (popup) popup.focus();
}
If I select value TEST in the select name="type", the function open parent page popup.htm in window popup; I select value and close window popup.

If I select again value TEST in the select name="type", the function NOT open parent page popup.htm in window popup.

Any suggestion ?

Code page.htm:

Code:
<select size="1" name="type" onchange="OpenPopup(this.options[this.selectedIndex].value, 'tbl', 'elm', 400, 200)">

  <option value="TEST">TEST</option>
  <option value="TEST_2">TEST_2</option>

</select>