473,382 Members | 1,329 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,382 software developers and data experts.

Small independent window

Pat
I want to submit an HTML form and have the reply appear in a small
window that overlays the form window. After the reply is read, the
user should be able to delete the small window, and then directly view
the whole form and resubmit it if desired.

Stated a different way, I'd like the equivalent of a simple dialog box
that the CGI can write into.

So far, about all I've accomplished is to resize the browser window,
then the user has to use the Back button to return to the form, then
click the resize button to enlarge the form's window to a useable
size.

Help!

Pat
Jul 23 '05 #1
4 1809
Ivo
"Pat" <pm********@yahoo.com> wrote in message
news:fd**************************@posting.google.c om...
I want to submit an HTML form and have the reply appear in a small
window that overlays the form window. After the reply is read, the
user should be able to delete the small window, and then directly view
the whole form and resubmit it if desired.


Look into the target attribute of the form element:
<form target="_blank">

HTH
Ivo
Jul 23 '05 #2
Set it up like this:

<form method="POST" action="results.htm" target="resultsWindow"
onsubmit="return popResults();" name="popResultsForm">
[Form fields here]
</form>

<script>
function popResults()
{
resultsWindow =
window.open('','resultsWindow','toolbar=no,locatio n=no,directories=no,status
=no,menubar=no,scrollbars=no,resizable=no,screenX= 100,screenY=100,top=100,le
ft=100,width=500,height=500');
}

This will send your results to a small plain window that will appear in
front of the main window. results.htm is the file that will appear in the
popup window, add your form information handling to it. Add a close button
to the popup window:

<input type=button value=Close onclick="self.close();">

And you are all set.
"Ivo" <no@thank.you> wrote in message
news:40*********************@news.wanadoo.nl...
"Pat" <pm********@yahoo.com> wrote in message
news:fd**************************@posting.google.c om...
I want to submit an HTML form and have the reply appear in a small
window that overlays the form window. After the reply is read, the
user should be able to delete the small window, and then directly view
the whole form and resubmit it if desired.


Look into the target attribute of the form element:
<form target="_blank">

HTH
Ivo

Jul 23 '05 #3
Pat
"Simon Wigzell" <si**********@shaw.ca> wrote in message news:<dasuc.625930$oR5.12186@pd7tw3no>...
Set it up like this:

<form method="POST" action="results.htm" target="resultsWindow"
onsubmit="return popResults();" name="popResultsForm">
[Form fields here]
</form>

<script>
function popResults()
{
resultsWindow =
window.open('','resultsWindow','toolbar=no,locatio n=no,directories=no,status
=no,menubar=no,scrollbars=no,resizable=no,screenX= 100,screenY=100,top=100,le
ft=100,width=500,height=500');
}

This will send your results to a small plain window that will appear in
front of the main window. results.htm is the file that will appear in the
popup window, add your form information handling to it. Add a close button
to the popup window:

<input type=button value=Close onclick="self.close();">

And you are all set.
"Ivo" <no@thank.you> wrote in message
news:40*********************@news.wanadoo.nl...
"Pat" <pm********@yahoo.com> wrote in message
news:fd**************************@posting.google.c om...
I want to submit an HTML form and have the reply appear in a small
window that overlays the form window. After the reply is read, the
user should be able to delete the small window, and then directly view
the whole form and resubmit it if desired.


Look into the target attribute of the form element:
<form target="_blank">

HTH
Ivo

Simon & Ivo:

Thank you both for your responses. I'm sure your answers will solve
my problem, and teach me something new, too.

Thanks again,
Pat
Jul 23 '05 #4
Simon Wigzell wrote:
Set it up like this:

<form method="POST" action="results.htm" target="resultsWindow"
onsubmit="return popResults();" name="popResultsForm">
[Form fields here]
</form>

<script>
The "type" attribute is missing for valid HTML 4.
function popResults()
{
resultsWindow =
window.open('','resultsWindow','toolbar=no,locatio n=no,directories=no,status
=no,menubar=no,scrollbars=no,resizable=no,screenX= 100,screenY=100,top=100,le
ft=100,width=500,height=500');
}
Most of the features you specified with the third argument of window.open()
are the defaults as of "DOM Level 0". Furthermore, since your assignment
lacks the `var' keyword, you are creating an global not properly initialized
and unnecessary here until further notice. Then you hide scrollbars while
making the popup of fixed size which is clearly a Bad Thing, and return
*nothing* (i.e. the `undefined' value) from the method but return that
Nothing to the return value of the called method to the event handler
instead of returning a boolean value. So after all,

function popResults()
{
window.open(
'',
'resultsWindow',
'scrollbars=yes,resizable=yes,left=100,top=100,wid th=500,height=500'
);

return true;
}

would be far better than what you wrote.
This will send your results to a small plain window that will appear in
front of the main window. results.htm is the file that will appear in the
popup window, add your form information handling to it.
No, it won't. What you forgot to take into account is that the popup window
requires a certain time to get "open", to have memory allocated for its GUI.
But since Window is a host object, the script engine is not responsible for
that but the API of the UA is.

A better, yet untested approach would be to wait until the popup's document
object is accessible and then return `true' and, in turn, return true to the
event handler so that the default handler would be used, submitting the form
data.

function popResults()
{
var w = window.open(
'',
'resultsWindow',
'scrollbars=yes,resizable=yes,left=100,top=100,wid th=500,height=500'
);

if (w)
{
while (!w.document) ;
}

return true;
}

Probably the best way is not to use popup "windows" at all for form
submission. They may be blocked or filtered, and if the user wants
to review his/her inputs (s)he can use the Back feature (button) of
his/her UA anyway.
Add a close button to the popup window:

<input type=button value=Close onclick="self.close();">

And you are all set.
No, you are not, on the contrary. IIRC the timing problems that arise
with such an approach have been discussed several times before here.
[Top post]


<http://jibbering.com/faq/#FAQ2_3>
PointedEars
Jul 23 '05 #5

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

Similar topics

4
by: Rex_chaos | last post by:
hi all, I am sorry for the post first for it's a very popular question here. However, I have seen thousand of post here but no one can tell me HOW TO MAKE A HOMEPAGE RESOLUTION-INDEPENDENT. I have...
3
by: Shiperton Henethe | last post by:
Hi Can anyone tell me how to open up a new normal, full-sized browser window from a small popup window? I'm using something like this. <script language="javascript"> <!--
1
by: David | last post by:
Hi, I have a page which lists data via asp & database. Against each record is a text link. This link opens a window, sized by a Javascript function in the link code. Problem: All further...
0
by: Mahir Karabacak | last post by:
Hi All, Is there anybody who has development based knowledge about Microsoft Remote Desktop Protocol (RDP) or Citrix Independent Computing Architecture (ICA). I need to know, do servers send...
7
by: Tim Rogers | last post by:
Hi folks, this is a resolution-detect script that I used on a site. As you can see it is designed to detect when the screen resolution falls below a certain level then load an alternative style...
74
by: lovecreatesbeauty | last post by:
My small function works, but I have some questions. And I want to listen to you on How it is implemented? 1. The function does not check if parameter x is larger or smaller than parameter y. ...
169
by: JohnQ | last post by:
(The "C++ Grammer" thread in comp.lang.c++.moderated prompted this post). It would be more than a little bit nice if C++ was much "cleaner" (less complex) so that it wasn't a major world wide...
6
by: Mark B | last post by:
I'd like a little window to pop up when a user clicks the hyperlink text "Grade Key": Grade Key Score Range A+ 95% - 100% A 90% - 94%...
1
by: mugdhajain | last post by:
Hi, I am working on an independent application to play flash files on Mac. I have already done the same for Linux, and it works flawlessly but on mac for some reason flash is not drawing to my...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.