Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I open a popup window with a fixed size using the HREF tag?

Tags:

html

php

asp.net

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

like image 696
Rajasekar Avatar asked Nov 07 '09 14:11

Rajasekar


People also ask

How do I open an HREF in a popup window?

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.

How do I change the size of the pop up window in HTML?

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.


2 Answers

This should work

<a href="javascript:window.open('document.aspx','mywindowtitle','width=500,height=150')">open window</a>
like image 147
Esben Skov Pedersen Avatar answered Oct 30 '22 09:10

Esben Skov Pedersen


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!

like image 36
Thomas Avatar answered Oct 30 '22 09:10

Thomas