Controlling size of new window from FORM button

They have: 11 posts

Joined: May 1999

Hey,

I am trying to figure out how I can control the width and height of a new window that appears when the user clicks on a FORM Submit Button.

FORM METHOD=POST ACTION="htps://somenewpage" TARGET="_blank" TITLE="newpagestitle"

This code works to open up a new blank page, though I would like to have the new window which opens to be somewhat small in size, though I don't have that much experience with FORM's and am little lost.

Does anyone know what I can do in the ACTION"" to control the size of the new window?

Thanks,
Tim

taff's picture

They have: 956 posts

Joined: Jun 2001

try calling a javacript function to create a new window with the size and features you want.

Instead of

action="http://newpage"

you would have

action="javascript:newWindow(newpage)"

.....

They have: 50 posts

Joined: Oct 2001

<script language=javascript>
function openwindow()
{window.open("http://www.tasfoundation.org/english/gift.htm")}</script>

You set the width and height yourself. Try it out and with your own url addresses. Hope this is helpful.

br
Tor-Andre Skogland
founder of TAS Foundation
http://www.tasfoundation.org

They have: 50 posts

Joined: Oct 2001

They have: 50 posts

Joined: Oct 2001

<script type="text/javascript">
function openwindow()
{
window.open("http://www.w3schools.com","my_new_window","toolbar=yes,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=no,copyhistory=yes,width=400,height=400")
}
</script>

br
Tor-Andre Skogland
founder of TAS Foundation
http://www.tasfoundation.org

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.