The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Javascript To Open PDF From Select Option
joehesse
post Sep 2 2018, 11:19 AM
Post #1





Group: Members
Posts: 7
Joined: 5-July 18
Member No.: 26,667



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Sep 2 2018, 04:50 PM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



Please see the FAQ entry How can I use forms for pull-down navigation menus?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Sep 2 2018, 11:31 PM
Post #3


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



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

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th March 2024 - 02:33 PM