473,394 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

cannot use JavaScript open window functions to open a request page??

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>

Jul 19 '05 #1
1 3316

I've never tried this, but I think if you create your target window through
javascript before the post event of your form goes off, you'll be loading
the result of your post in this newly created window.

You set the target attribute to "_blank", but you can also specify a
windows name in there, eg. "mywindow". So if you use JavaScript to create a
window with the name "mywindow" before you post your form, the browser will
probably use that window to display the forms result.

"Matt" <ma*******@hotmail.com> wrote in message
news:us*************@TK2MSFTNGP10.phx.gbl...
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>

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: rathnesh | last post by:
when using a web application which includes taking an asp page then going to another asp page and coming back to first page ...some times connection to iis gets terminated and page canot be...
3
by: fig000 | last post by:
Hi, I'm relatively new to Javascript so please bear with me on what might sound like silly questions. This is what I want to do: I'm working in classic asp (I have to for this project). I...
9
by: Charlene Russ | last post by:
Learn on-line at your own in a user-centered format with plenty of interaction and personal attention. This is a basic level coursed designed to introduce the novice to intermediate computer...
3
by: Shapper | last post by:
Hello, I am working on an ASP.NET/VB web site. I have several links including menu links. Considerer a want to load a page named page.aspx. I can do it using javascript. Or using this code:...
4
by: Brie_Manakul | last post by:
I need to set up an if else to show different weather scripts based on the city selection they choose. Any help on this would be great. Thanks! <%@ page language="java" import="java.util.*,...
3
by: anthonybrough | last post by:
I have an asp page that has a form to collect user data in a form. when the user clicks submit the input is validated. If any fields are not acceptable the user clicks on a button to go back to...
4
by: sirjohnofthewest | last post by:
If I possessed the power to sway the mind of every user in the world to delete all forms of Internet Explorer I would die a happy man. Hi guys, I frequently visit this site to get answers to my...
1
by: wenijah | last post by:
Hi everyone! First thank you for reading this post and yes, you probably already see that kind of topic title somewhere but the problem I've got today might be different than the 100 topics I've...
5
by: loveshack | last post by:
Can anyone help me please (i am quite a novice, but having fun learning). Im not sure if this is an ASP problem, a javascript problem or a browser problem. Firstly, everything i have written...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.