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
rsajjarsajja 

How can I reference a visualforce page from button using 'onclick' or by using 'action' ?

<button type="button">Print</button>
3 Creeks3 Creeks
<button type="button" onclick="showPage(this); return false;">Print</button>

.....

function showPage(event) {
        	var url='/apex/myPage';
        	var winWidth = 1070, winHeight = 600;
		var mouseX = event.screenX;
		var mouseY = event.screenY;
			
           	newWin=window.open(url, 'My Page','height=1070,width=600,left=' + (mouseX - (winWidth + 20)) +
           								',top=' + (mouseY + 50) + ',resizable=no,scrollbars=yes,toolbar=no,status=no');
            
            if (window.focus) {
                newWin.focus();
            }
                        
            return false;
}