Click to See Complete Forum and Search --> : Help needed !


Charles_cz
11-25-2002, 06:52 PM
I have the form on main page. I need to send form to cgi and open new window of certain size.

Here is the link.

Form (http://www.chicago-cz.com/cgi-bin/aj/slovnik.pl )


Here is form code.

<form action= 'http://chicago-cz.com/cgi-bin/aj/slovnik.pl?slovo' method="post" target="_blank" >
<table width="236" height="64" border="0" cellpadding="0" cellspacing="0" bgcolor="4880A0">
<tr>
<td width="1%" height="32" class="jazyk">&nbsp;</td>
<td width="29%" height="32" class="jazyk">Cesky</td>
<td width="48%" class="jazyk">&nbsp; Anglicky</td>
<td width="18%" class="jazyk"><div align="center">
<input name="image2" type="image" src="http://www.chicago-cz.com/anglictina/images/preloz.gif" input>
</div></td>
<td width="4%" rowspan="2" class="jazyk">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td valign="middle"><input name="czech" type="text" id="czech" size="10"></td>
<td colspan="2" valign="middle"><div align="center">
<input name="english" type="text" size="10">
</div></td>
</tr>
</table>
</form>


Everything works fine, but I have no idea how to set size of new window. I know it's possible to do that with java script. Can I some how combine java script & form with POST method to resolve my problem? May be there is very sipmple solution and I just do not know about that. ( Learning all the time :rolleyes:)

I will appriciate any advise o suggestion.

Thanks Charles

Charles
11-25-2002, 07:03 PM
<form action="http://chicago-cz.com/cgi-bin/aj/slovnik.pl?slovo" method="post" target="child" onsumbit="window.open('', 'child', 'height=400,width=300')">

The ONSUBMIT handler gets called just before the form is submitted and opens a your new window and names it 'child'. The TARGET attribute puts the reply in the window named 'child'.

Charles_cz
11-25-2002, 07:22 PM
I made changes as suggested.

Form with ONSUBMIT handler . (http://chicago-cz.com/cgi-bin/aj/slovnik.pl)

For some reason it doesn't work. Any idea?

Thank you Charles

Charles
11-25-2002, 07:26 PM
Did you include the TARGET attribute? Can you attach the file or post the URL?

Charles_cz
11-25-2002, 07:45 PM
I have posted link to form page in last message. You can see tags in source of html page. I put it there exactly as you wrote.

Anyway, here is the code.

<form action="http://chicago-cz.com/cgi-bin/aj/slovnik.pl?slovo" method="post" target="child" onsumbit="window.open('','child', 'height=100,width=100')">';

and here is the link

Link (http://www.chicago-cz.com/cgi-bin/aj/slovnik.pl)

It will open new window but it doesn't have right size. :confused: (100X100 in my case for testing purposes).

Charles

Charles
11-25-2002, 07:48 PM
Oops, I'm sorry about this but it's ONSUBMIT.

Zach Elfers
11-25-2002, 08:03 PM
You can't change the size of a target="_blank" window. But you can use JavaScript to open a new window:

function NewWindow() {
newWin = window.open("newWindow", "height=whatever,width=whatever,location=yes,status=yes,toolbar=yes,menubar=yes");
newWin.focus();
}

Hope that helps!:)

Zach Elfers
11-25-2002, 08:04 PM
Sorry, someone said this already. I didn't know.

Charles_cz
11-25-2002, 08:05 PM
LOL.. I wish I had better English. That way I could notice that right away.

Thank you for your time. I appreciate that.