Hallo,
um ein neues Fenster per Link zu öffnen, geht das mit folgendem Code:
Ich möchte jedoch in einem Form die gleiche Funktion per Button ausführen. Mein Code funktioniert jedoch nicht. Es gibt keine Reaktion.
Das Form drumherum hat mit dem Button nicht zu tun. Das Button ist nur im Form eingebettet.
Könnt Ihr mir bitte helfen?
um ein neues Fenster per Link zu öffnen, geht das mit folgendem Code:
HTML-Code:
<html> <head> <title>Kein Titel</title> <script language="JavaScript"> <!-- function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable) { toolbar_str = toolbar ? 'yes' : 'no'; menubar_str = menubar ? 'yes' : 'no'; statusbar_str = statusbar ? 'yes' : 'no'; scrollbar_str = scrollbar ? 'yes' : 'no'; resizable_str = resizable ? 'yes' : 'no'; window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str); } // --> </script> </head> <body bgcolor="white" text="black" link="blue" vlink="purple" alink="red"> <p>neues <a href="javascript:na_open_window('arbeitsbereiche', 'file:arbeitsbereiche.html', 200, 200, 300, 300, 0, 0, 0, 1, 1)" target="_self">fenster</a></p> </body> </html>
HTML-Code:
<head> <script language="JavaScript"> <!-- function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable) { toolbar_str = toolbar ? 'yes' : 'no'; menubar_str = menubar ? 'yes' : 'no'; statusbar_str = statusbar ? 'yes' : 'no'; scrollbar_str = scrollbar ? 'yes' : 'no'; resizable_str = resizable ? 'yes' : 'no'; window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str); } // --> </script> <script language="JavaScript"> <!-- document.getElementById("arbeitsbereiche").onclick = na_open_window('arbeitsbereiche', 'file:arbeitsbereiche.php', 200, 200, 300, 300, 0, 0, 0, 1, 1) // --> </script> </head> <body bgcolor="white" text="black" link="blue" vlink="purple" alink="red" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0"> <form name="suchen" method="GET" action="objekte.php"> <button type="button" id="arbeitsbereiche" style="font-family:'Arial'; font-weight:bold; color:rgb(255,0,0);">...</button> </form>
Könnt Ihr mir bitte helfen?
Kommentar