Click to See Complete Forum and Search --> : Popup Window Formatting


atnpowell
01-08-2004, 05:11 AM
HI there

I am having a problem with what should be a simple pop-up window task.

Below are the three sections of code I'm using to try to submit a form using a text link (ie the word "Help") and openning a small window which will Request the user variable passed.

Everything works fine except the window attributes are completely ignored ... no matter what I try the formatting set in formpop() doesn't register.


**POP UP WINDOW FUNCTION**

function formpop()
{
formWin = window.open('about:blank', 'formWin', 'width=200, height=200');
if (formWin && !formWin.closed)
formWin.focus();
return true;
}


**FORM WITH HIDDEN FIELD TO PASS TO POPUP**

<form action="help.asp" method="get" name="frmHelp" target="formWin" id="frmHelp" onsubmit="return formpop()">
<tr>
<td height="19"></td>
<td valign="top"><input type="hidden" name="user" value="<%=(rsPaperlessUsers.Fields.Item("Username").Value)%>" /></td>
<td></td>
</tr>
</form>


**TEXT LINK THAT SUBMITS FORM**

<a href="javascript:document.frmHelp.submit()">Help</a>


Most of this code seems to follow the classic popup examples found across the web ... so what's going wrong ??

much thanks (in advance)

Andy

Kor
01-08-2004, 07:20 AM
As far as I know the correct syntax is

window.open('url_here', 'name_or_target_here', 'other_attributes_here');

so try

window.open('popup.html', '_blank', 'width=200, height=200');

or similar