Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Client-side Scripting _ Javascript To Open PDF From Select Option

Posted by: joehesse Sep 2 2018, 11:19 AM

Hi,
I have the following in my html file: The file was generated from php on the server.

<select id="MyFiles">
<option value='dir/file1.pdf'>file1</option>
<option value='dir/file2.pdf'>file2</option>
<option value='dir/file3.pdf'>file3</option>
</select>

In the above, "dir" is a folder above the html server root directory.
When the user clicks on a row I would like the pdf to open in a separate tab. What jquery or javascript do I need to do this?

Thank you,
Joe

Posted by: Darin McGrew Sep 2 2018, 04:50 PM

Please see the FAQ entry http://www.htmlhelp.com/faq/html/forms.html#form-navmenu

Posted by: pandy Sep 2 2018, 11:31 PM

And there's problem with where you have the files.

QUOTE(joehesse @ Sep 2 2018, 06:19 PM) *

In the above, "dir" is a folder above the html server root directory.


You can't access files located above the web root from the web. And, if you could, those URLs would be wrong. wink.gif


Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)