On Mon, Mar 25, 2013 at 10:01:03AM -0400, Jim Giner wrote:

> target as in the form attribute
> In my appl devl I utilize an extra window when my current form is
> asked to generate a pdf report.  Works well since that way the user
> can generate one report into a new window, read it, close it, and
> still have the reports menu in front of him/her and generate a 2nd
> report.
> I'm experiencing a problem tho and I'm guessing it's associated with
> ie9 or FPDF. In my reports menu form, when I click on a button that
> will generate a pdf, I alter the form's target to create a new
> window.  This used to work last fall, but since then I have a new
> laptop running ie9, not 8.  The target changing js logic is working
> as far as I can see (alerts in my js) but the effect is not there.
> Instead of a new window, the pdf opens up in the same window where
> the menu was and so when the user does a back he ends up going up
> one too many levels and has to re-request the reports menu.
> Didn't have this much trouble originally setting this up as I'm
> having now trying to debug this.  I'm using the FPDF extension/class
> to generate my pdfs - made no recent changes there.  Also my concept
> works very well still in a simple html document that has only two
> buttons on it which I created today to test a theory.  That is -
> maybe it's not just IE9, but FPDF.
> Anyone have any experience in this area?

This behavior of the browser actually conforms to the standard as far as
I know. The "target" attribute is attached only to the <a> tag,
according to w3schools.com. It may work when you use it with a form tag,
it doesn't surprise me if IE doesn't honor it (of course, nothing IE
does would surprise me). In any case, using it with the form tag appears
to be non-standard usage, which may or may not be supported by
individual browsers.

I handle this situation differently. My "generator" code (also using
FPDF) dumps the PDF in a PDF directory. Then I provide a link elsewhere
with an Adobe Acrobat logo which, when clicked, opens the PDF in a
separate window, using the aforementioned 

<a href="example.com/pdfs/something.pdf" target="_blank">My PDF</a> 


In any case, I doubt very much FPDF has anything to do with this. It
just dumps its creation to wherever you tell it. The browser determines
what helper application it will use to open it when it downloads the
content. Whether to open a separate window/tab is determined by the
HTML the browser is looking at when it makes the content request.


Paul M. Foster

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to