Good day to every one im trying to centre the pop up window and not sure how to make it. below is the script <script language="javascript"> function target_popup(form) { window.open('', 'formpopup', 'width=900,height=400, resizeable,scrollbars,'); form.target = 'formpopup'; } </script> HTML: <form id="theform" name="order" method="post" action="confirm.php" onsubmit="target_popup(this)" enctype="multipart/form-data" style="position:absolute; left:0px; top:0px"> Code (markup): Thank you
You will need the width & height of the window: function popupwindow(url, title, w, h) { var left = (screen.width/2)-(w/2); var top = (screen.height/2)-(h/2); return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left); } Code (markup): Source