function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ATSATS 

Window Sizing

I have a button that opens a VF page in a new window to collect a few fields of data.  I have the header and sidebar hidden in this new page.  I'd like the new page to be about smaller that a normal full window.  I can add css width and height on Pageblock, but that doesn't seem to work.  Can anyone offer the best way to do this?
Best Answer chosen by Admin (Salesforce Developers) 
metaforcemetaforce

You can specify the popup window features, in your case to set the hieght & width, following code can work:

 

window.open ("http://www.javascript-coder.com",mywindow",

"location=1,status=1,scrollbars=1,width=100,height=100"); 

 

Check out the following links as well: 

 

http://www.htmlite.com/JS016.php

 

http://www.javascript-coder.com/window-popup/javascript-window-open.phtml 

 

 

AD

-------------------------------------------------------------------------------------- 

Mark it as an accepted solution if it works and help the community 

All Answers

metaforcemetaforce

You can specify the popup window features, in your case to set the hieght & width, following code can work:

 

window.open ("http://www.javascript-coder.com",mywindow",

"location=1,status=1,scrollbars=1,width=100,height=100"); 

 

Check out the following links as well: 

 

http://www.htmlite.com/JS016.php

 

http://www.javascript-coder.com/window-popup/javascript-window-open.phtml 

 

 

AD

-------------------------------------------------------------------------------------- 

Mark it as an accepted solution if it works and help the community 

This was selected as the best answer
ATSATS
I ended up using the Window Open Properties which can be found my clicking on the link to the custom button.  This proved to work better than the Javascript method.