Click to See Complete Forum and Search --> : When submit a form, popup new window
ovisopa
01-13-2003, 03:26 PM
Hello,
I have a form and when i press submit button I want to open a new popup window with no adress bar, no toollbar like in any photo gallery, just the title and the content of it with no toolbars.
The new window will be the page that form has in action="page.php" . Can this be done by a javascript ? Can you help me?
Anyway 10x for reading this post :) .
mawood
01-13-2003, 03:33 PM
Like this?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script language="JavaScript">
<!--
function popitupdude() {
floatwindow=open("","","width=690,height=560")
floatwindow.location.href="page.html"
return true;
}
// -->
</script>
</head>
<body>
<form action="" onSubmit="return popitupdude()">
<input type="submit">
</form>
</body>
</html>
If you done want to submit the form, change the reurn true; to return false;
Yea--it can be done...
<SCRIPT Language="JavaScript">
function openWindow() {
var the_window = window.open("","name","
width=400,height=400,scrollbars=yes,
menubar=no,status=no")
the_window.document.write("<html><head>");
the_window.document.write("<title>myTitle</title>");
the_window.document.write("</head><body bgcolor='#FFFFFF'>");
the_window.document.write("<P align='justify'>Hellow, World!</P>");
}
</SCRIPT>
</HEAD><BODY>
<form name="frm" onSubmit="openWindow()">
<!--All of your form elements go here-->
</form>
This code will make a dynamic page that exists only in memory. If you have another file that you want to popup, change:
var the_window = window.open("the_file.html","the_name")
Just add your parameters...
ovisopa
01-13-2003, 04:42 PM
Hello and 10x for the script but it's not working , maibe I was wrong and that's why I put the script and the first line of the form.
<SCRIPT Language="JavaScript">
function openWindow() {
var the_window = window.open("sondaj_echo.php","Sondaj"," width=400,height=400,scrollbars=yes, menubar=no,status=no");
//var the_window = window.open("","name"," width=400,height=400,scrollbars=yes, menubar=no,status=no") target="_blank"
}
</SCRIPT>
<form name="sondaj" action="sondaj_echo.php" method="post" class="linksmall" onSubmit="openWindow()">
In internet Explorer the code is doing nothing , the form it's working normaly, but in Opera a new popup window apears with no tollbar, no adressbar just like it's set in the javascript but the values from the form seems that are not sent to the php file.
For now I will use just on form this : target="_blank" until I find something that's working.
10x anyway for help.
see ya all
Try this in Explorer:
<SCRIPT>
function openWindow() {
window.open("sondaj_echo.php","Sondaj"," width=400,height=400,scrollbars=yes, menubar=no,status=no");
</SCRIPT>
<form name="myForm" action="form.php" method="POST">
<input type="text" name="name" value="Enter your name">
<br>
<input type="button" onClick="openWindow(); form.submit()" value="Submit">
That should work :D