Submit a form into a popup

Sometimes it is useful to submit a form into a popup window, here are two simple ways to do it (simple is the key here, so popup blockers don’t think it’s spam) :

<form action="foo.php" method="post" target="POPUPW"
onsubmit="POPUPW ='about:blank','POPUPW',
<input type="submit" name="sub" value="Submit in Popup">

– or –

<form action="foo.php" method="post" name="myform">
<input type="submit" name="subpopup" value="Submit in Popup"
onclick="'POPUPW'; POPUPW =
<input type="submit" name="subnormal" value="Submit Normal">

and on a similar topic here is a way to do simple link popups (so they also work with no javascript enabled)

<a href="test.htm" target="pop" onclick=",'pop',


1 thought on “Submit a form into a popup

Leave a Reply

Your email address will not be published.