Re: Re: JavaScript Help
| From: | Joao Prado Maia | Date: | Fri, 25 Aug 2000 21:44:46 +0000 |
| Subject: | Re: Re: JavaScript Help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-13743@lists.php.net to get a copy of this message | ||
At 11:16 PM 8/25/2000 +0200, Chris Hayes wrote:
That is true, "about:blank" means "show a blank page to user" in IE, but who cares, the code is supposed to submit the form on this new window that the javascript just created. So the "blank" page would never appear, only the results of the form. And again, this works perfectly in Netscape.From: Joao Prado Maia <jpm@kefta.com> Subject: JavaScript HelpOk, I have a form in a page, and I want to target the results to a new window. Internet Explorer creates the little window that I want, but it doesn't show anything in there, and then creates another window (big one) with the results of the form. "blank" might mean a white page to IE. At least "about:blank" does. So better choose another name.
<script language="JavaScript">
<cut>
windowVar = window.open("blank.html", "_enquetes",
"width=420,height=460,top=30,left=30,resizable=no,scrollbars=yes,toolbar=no,l
ocation=no,menubar=no,status=no");
A very good start. Now add
windowVar.location.href="http://etc.etc/etc/etc.html"
(or without the .href part maybe)
it is important to give the full path.
but using a full path is not cool when you're testing offline. Peek at
www.bolster.nl in index to see how i sort of solved that. (a URLbase
variable detecting domain and path)
I can try using this, but I don't think it's going to work. This line of javascript code you gave me is just going to change the page the new little window is going to show up. But remember, the form is going to be submitted on this same window, so no matter what page you load in there, it is supposed to be history.
Sometimes this means you lose focus from the javascript to the child window. Uh oh. These nice ideas with child windows are nice but they always are a headache. That's why you hardly ever see them. For instance I worked weeks on a code to keep a child window in front, or bring it in front again. IE just hates that. I had to use some vbscript!I'm also going to try to use windowVar.focus() or whatever. Who knows!
var set_timeout = setTimeout("this.document.enquetes.submit();", 9000); } <form name="enquetes" target="_enquetes" method="get" action="enquetes.php"> If in anyway possible use method=POST when using forms, with get you are quite limited, in _some_ browsers only 200 characters (don't ask how long this took to figure out). Read the manual about how variables become available to you in a different way.Yes, and I know that. However, I don't want the user to see that "Confirm passing important data" splash window on IE / Netscape. If that happens, the new little window is already there, and the user is reading the message from the splash window. And the form is only going to be submitted, and the results shown on this new window, when the user clicks "OK" or whatever the button is. The POST method is not a good option for me on this one.
About the target: hmm. I don;t think the name you gave to the window is a valid target. This may explain the new browser window being opened! Rather try the location.href.The form target you mean ? I can name it "_enquetes" or "_newone" and it should work. Anyway, I'll try renaming the form target / window name just in case.
Netscape, but there gotta be a way out of this. I already tried using onSubmit="window.open" without all stuff (between the brackets)??No, with everything inside the brackets. I was just too lazy to write everything again :)
hth, ChrisThanks Chris -- Joao Prado Maia Web Developer Kefta.com, Inc