I have problem with this function javascript:
Expand|Select|Wrap|Line Numbers
- 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 again value TEST in the select name="type", the function NOT open parent page popup.htm in window popup.
Any suggestion ?
Code page.htm:
Expand|Select|Wrap|Line Numbers
- <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>