I have a link like this:
$contact_url = "<a href=rentals_popup.php?id=$row->rentals_id >" . "Contact" . "</a>";
How can I open that page in a different window with?
Smaller width and height
Disabled maximize button
Normally links get opened in the same window in which they are clicked in. In order to open them in a new window, we add target="_blank" attribute to links. However to open the links in a separate popup window, we can make use of the onclick property and specifying a inline JavaScript code window.
You can set height and width of your popup window by using window. resizeTo(preferedWidth, preferedHeight) function. If you want to set this inside a popup window not from parent window than self. resizeTo(preferedWidth, preferedHeight); will do the job for you.
This should work
<a href="javascript:window.open('document.aspx','mywindowtitle','width=500,height=150')">open window</a>
Plain HTML does not support this. You'll need to use some JavaScript code.
Also, note that large parts of the world are using a popup blocker nowadays. You may want to reconsider your design!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With