Re: JavaScript Help

From: Date: Fri, 25 Aug 2000 21:16:30 +0000
Subject: Re: JavaScript Help
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-13737@lists.php.net to get a copy of this message
From: Joao Prado Maia <jpm@kefta.com> Subject: JavaScript Help > Ok, 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) 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! > 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. 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. > Netscape, but there gotta be a way out of this. I already tried using > onSubmit="window.open" without all stuff (between the brackets)?? hth, Chris -------------------------------------------------------------------- Chris Hayes Droevendaalsestg. 35 6708 PB Wageningen the Netherlands http://www.xs4all.nl/~chayes/

« previous php.general (#13737) next »