...

View Full Version : specifying size of target window



kovalik
02-06-2005, 06:58 PM
hi,

Is there a way to specify the size and position of the [target="_blank"] window in the following code?

Thanks!

<form action='http://www.elia.org/search/default.asp' method='post' target="_blank">
<input name=Criteria type=text size=12 maxlength=50>&nbsp;<input class=bodytext name=submit type=submit value=' Go '>

chilipie
02-06-2005, 07:44 PM
You could only do this with JS... Messing with the user's browser window is not a good idea - it tends to make people mistrust you.

Jalenack
02-06-2005, 08:01 PM
I agree with chilipie, however window resizing in target windows is acceptable IMO. However, I think you could have searched a little harder before posting. This very forum is infested with such questions, as is a quick google search. Anyhoo, here's how

<a href="link.html" target="AutoWindow" onClick="window.open('','AutoWindow',& #39;toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,r
esizable=no,width=400,height=480')">Link</a>

I assume you know how to change all that to your specifications..

kovalik
02-06-2005, 10:34 PM
Thanks for the help. I'm sorry I wasn't clear enough in my first question. My question is more than just opening a new window.

I know how to open new window from a link, but I am having a problem because this is part of a form.

When I apply the JS to the "Go" button, the new window opens, but the search results page also opens. If I don't specify _blank in the code, the results page still opens in the original page. Then I have the results page in the original page and the new window.

What I am trying to do is to open a new page (specifying the size and position) with the search results in it, but have the original page stay as is.

(Here is the code again)

<form action='http://www.elia.org/search/default.asp' method='post' target="_blank">
<input name=Criteria type=text size=12 maxlength=50>&nbsp;<input class=bodytext name=submit type=submit value=' Go '>

rmedek
02-06-2005, 11:43 PM
I'm afraid there isn't any way of doing this using HTML/CSS only. You're asking to change the default browser behavior, which is in the realm of Javascript (maybe even server-side programming like PHP). Pick which ever program you hate the least and pm a moderator to move this question to the appropriate forum, that should help you get the answers you need...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum