Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 14th, 2004, 12:33 AM
SoC SoC is offline
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default set size of window on load

Hi,

I'm opening a new window(target= "_blank") from a submit button. I would like to be able to set the size of this new window.

I know how to do it with javascript on a standard hyperlink, but I'm not sure how to do it when using a submit button.

Can I set the size of the new page from within that new page?

That is, instead of setting the size using javascript on the parent page, you set the size of the child page from within the child page.

I hope that makes sense. Alternatively, is there a way of using the javascript with the submit button?

cheers
s

Reply With Quote
  #2 (permalink)  
Old September 14th, 2004, 01:23 AM
Friend of Wrox
Points: 1,288, Level: 14
Points: 1,288, Level: 14 Points: 1,288, Level: 14 Points: 1,288, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2004
Location: Stockholm, Sweden
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

Dear here is a java script function which will open a new window

function ak_help()
    {
        showModalDialog(subdirectory + "help1.html", "", "dialogHeight:300px; dialogWidth: 400px; scroll: no; status: no; help: no;");
    }



Numan
--------------------------------------------------
Love is the most precious thing of this world. So find it and grab it!
Reply With Quote
  #3 (permalink)  
Old September 14th, 2004, 03:09 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi s,

You can do it with
Code:
window.resizeTo(xValue, yValue);
HTH,

Chris

Reply With Quote
  #4 (permalink)  
Old September 14th, 2004, 03:22 AM
SoC SoC is offline
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Cheers,

I worked out how to do it - I used window.resizeTo as ChrisScott also suggested.
Here's the code for anyone interested:

<script language="JavaScript">
function setSize(){
window.resizeTo(300,300);
}
</script>
</head>
<body onLoad="setSize();">

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Customizing the window size tenvuong BOOK: Ivor Horton's Beginning Visual C++ 2005 0 March 31st, 2008 09:16 AM
set up image size goldenstate BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 4 February 15th, 2007 07:37 PM
Parse/Load/Search xml file size near about 1 GB sandeep_akhare XML 4 September 19th, 2006 04:47 AM
Window or Page size ckrajeshvarma ASP.NET 2.0 Professional 0 August 6th, 2006 12:53 AM
Window Size ckrajeshvarma ASP.NET 2.0 Basics 0 August 6th, 2006 12:50 AM



All times are GMT -4. The time now is 04:24 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.