Axel Richter: Fenster öffnen in Formular

Beitrag lesen

Nochmal zum Verdeutlichen: Ich hab einen Button und ein Text-Feld. Wenn ich auf den Button klicke, soll ein neues Fenster geöffnet werden, dass ich aber mit Javascript (open) einrichten möchte, und dessen Inhalt shorts/index.php?bs=TEXTFELDINHALT ist...

MfG Christoph

Dann ist dein Problem nicht "Wie öffne ich ein Fenster bei Submit?" sondern "Wie greife ich auf ein HTML-Objekt zu?". Probiers mal so:

<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title></title>
<script type="text/javascript">
  <!--
  function oeffnen()
  {
    //alert("shorts/index.php?bs=" + document.myform.bs.value);
    window.open("shorts/index.php?bs=" + document.myform.bs.value ,"Shorts","width=500,height=300,left=50,top=50, hotkeys=no, location=yes, menubar=no, resizable=no, status=no, toolbar=no, scrollbars=yes");
  }
  //-->
</script>
</head>
<body>
<form action="javascript:oeffnen();" method="post" name="myform">
  <td width="100%" background="img/hg.jpg"><input type="text" name="bs" value="Eingabe" size="20">
  <input type="submit" value="OK">
</form>
</table>
</body>
</html>

Grüße

Axel