Matthias: popup durch form klicken öffnen

Beitrag lesen

PS: wer diesen Beitrag verfolgt hat, hier der fertige Code. So wird ein super Browserfenster zentriert in jedem Browser geöffnet:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Unbenanntes Dokument</title>
<script language="JavaScript" type="text/JavaScript">
function openWindow(pUrl,windowName,width,height,scroll)
{
        x = (640 - width)/2, y = (480 - height)/2;
        if (screen)
        {
                y = (screen.availHeight - height)/2;
                x = (screen.availWidth - width)/2;
        }
        if (screen.availWidth > 1800)
        {
                x = ((screen.availWidth/2) - width)/2;
        }
        if (scroll==null)
        {
            scroll='scrollbars=no';
        }
        else
        {
            scroll='scrollbars=yes';
        }
        window.open(pUrl,windowName,'width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x+','+scroll);
}
</script>

</head>

<body>
<form id="form1" name="form1" method="post" action="do.php"
 onSubmit=openWindow("","testbox","300","200","no"); target="testbox">

<input type="text" name="textfield">

<input type="submit" name="Submit" value="Senden">

</form>
</body>
</html>

Grüsse
Matthias