This topic is locked

Open Pdf In New Window

5/15/2013 12:17:35 PM
PHPRunner General questions
K
KennyB author

I have created a PDF from the ADD screen Before record added event and it works perfectly. IT iwll even open up. I would like to have this PDF open in a New tab or a new window.
This is what I have so far and it bombs..
window.open("http://".$_SERVER['HTTP_HOST']."/wpcpermits/".$docnamef,'mywindow','width=400,height=200';);
what am I missing.
What program does is before the record is added it creates a form on the fly and shows it. Just looking to get to new window..
Thanks in Advance

Sergey Kornilov admin 5/15/2013

window.open is a Javascript function and won't work from PHP event.
When and where do you want to open that PDF file?

K
KennyB author 5/15/2013



window.open is a Javascript function and won't work from PHP event.
When and where do you want to open that PDF file?


Looking to open it right after it is created. Which is in the ADD screen .. Then hit SAVE button and code is in BEFORE record Added event
was flowing nice except for fact it opened in same window so I kind of lost my screen i was looking at.

Sergey Kornilov admin 5/15/2013

This is the issue. On the server side you can only redirect user to another URL.
Opening an URL in new window/tab requires Javascript and needs to be initiated by the user manually.

K
KennyB author 5/15/2013



This is the issue. On the server side you can only redirect user to another URL.
Opening an URL in new window/tab requires Javascript and needs to be initiated by the user manually.


Not as easy as one would think then. Maybe I just keep as is for now and move on. Looks like no way to launch Jave script on client side in Event I was in .. Figures... Thanks for the information

Sergey Kornilov admin 5/15/2013

I think the best you can do is to display a link to this document after record was added and this link can be open in new tab/window. User still needs to click it though.