My problem is when the user click the submit button, it will launch another
new window for the request page. I want to confirm we cannot use JavaScript
open window functions to open a request page? The following page2.asp won't
output the value entered in page1.asp. However, if we do <form
action="page2.asp" method="get" target="_blank">, then it will open a new
window for the request page, instead of using the same window as page1.asp.
But I want to use JavaScript window.open() or window.showModalDialog(),
seems like impossible?? If we use regular button (<input type="button"...>),
then
we can use JavaScript open window, but this is not posting form. Right??
Please advise! Thanks!!
//page1.asp
<html>
<body>
<head>
<script type="text/javascript">
function openwindow()
{
var sReturn = window.showModalDialog("page2.asp", document,
"dialogHeight:700px; dialogWidth:500px;");
}
</script>
</head>
<body>
<form action="page2.asp" method="get">
<P>First Name: <input type="text" name="fname">
<P>Last Name: <input type="text" name="lname">
<P><input type="submit" value="validate" onclick="openwindow()">
</form>
</body>
</html>
//page2.asp
<html>
<body>
<P>first name from page1.asp = <%= Request.QueryString("fname") %>
<P>Last name from page1.asp = <%= Request.QueryString("lname") %>
</body>
</html>