Computing.Net > Forums > Web Development > open pdf files in drop down menu's

open pdf files in drop down menu's

Reply to Message Icon

Original Message
Name: Stephen Allden
Date: March 23, 2006 at 16:49:53 Pacific
Subject: open pdf files in drop down menu's
OS: Windows 98
CPU/Ram: 533Mhz, 191.0MB
Model/Manufacturer: Packard Bell (Nec)
Comment:

Hiya in the html code below i'm trying to load different pdf files from different options selected but it don't load the application (Adobe reader) can someone help me out!

cheers.


Report Offensive Message For Removal

Response Number 1
Name: Stephen Allden
Date: March 23, 2006 at 16:50:51 Pacific
Subject: open pdf files in drop down menu's
Reply: (edit)

the code...

<select onchange="open(this.options[this.options.selectedIndex].value)">
<option>Please Select...</option>
<option value="pdf\octobermem05.pdf">October (Members Meeting)</option>
<option value="pdf\october05.pdf">October (Committee Meeting)</option>
<option value="pdf\september05.pdf">September (Committee Meeting)</option>
<option value="pdf\august05.pdf">August (Committee Meeting)</option>
<option value="pdf\july05.pdf">July (Committee Meeting)</option>
<option value="pdf\june05.pdf">June (Committee Meeting)</option>
<option value="pdf\memmay05.pdf">May (Members Meeting)</option>
<option value="pdf\may05.pdf">May (Committee Meeting)</option>
<option value="pdf\aprilagm05.pdf">April (Annual General Meeting)</option>
<option value="pdf\march05.pdf">March (Members Meeting)</option>
<option value="pdf\februaryagm05.pdf">February (Committee Meeting)</option>
<option value="pdf\january05.pdf">January (Members Meeting)</option>
</select>


Report Offensive Follow Up For Removal

Response Number 2
Name: Michael J (by mjdamato)
Date: March 23, 2006 at 21:01:37 Pacific
Subject: open pdf files in drop down menu's
Reply: (edit)

Use this instead:

<select onchange="document.location.href=this.options[this.options.selectedIndex].value;">

Michael J


Report Offensive Follow Up For Removal

Response Number 3
Name: Stephen Allden
Date: March 24, 2006 at 14:39:11 Pacific
Subject: open pdf files in drop down menu's
Reply: (edit)

it doesn't work!


Report Offensive Follow Up For Removal

Response Number 4
Name: Michael J (by mjdamato)
Date: March 24, 2006 at 17:56:01 Pacific
Subject: open pdf files in drop down menu's
Reply: (edit)

It worked for me when I tested it. Are you sure you have the path and names of the pdfs correct? Have you posted it somewhere that I can take a look?

Michael J


Report Offensive Follow Up For Removal

Response Number 5
Name: Stephen Allden
Date: March 25, 2006 at 06:22:37 Pacific
Subject: open pdf files in drop down menu's
Reply: (edit)

yer check out....

http://www.stephenallden.uspechosting.co.uk/menu_problem/test.htm


Report Offensive Follow Up For Removal


Response Number 6
Name: Michael J (by mjdamato)
Date: March 25, 2006 at 09:04:12 Pacific
Subject: open pdf files in drop down menu's
Reply: (edit)

Well, the code is working, it looks like the pdf just doesn't exist at the path! When I try it the URL changes in the browser address bar and the page attempts to load it, but the specified pdf doesn't exist at that location. According to that test you should have a pdf located here:

http://www.stephenallden.uspechosting.co.uk/menu_problem/pdf/userguide.pdf

Where is it?

Michael J


Report Offensive Follow Up For Removal

Response Number 7
Name: Stephen Allden
Date: March 25, 2006 at 09:53:10 Pacific
Subject: open pdf files in drop down menu's
Reply: (edit)

i've sorted it out, it works now....thanks for all your help mate really appreciate it cheers!!!


Report Offensive Follow Up For Removal

Response Number 8
Name: Stephen Allden
Date: March 25, 2006 at 10:12:00 Pacific
Subject: open pdf files in drop down menu's
Reply: (edit)

oh! before i forget...sorry to sound extra but how to i make the pdf files load in a new window (_blank) when selected from the menu.


Report Offensive Follow Up For Removal

Response Number 9
Name: Michael J (by mjdamato)
Date: March 25, 2006 at 11:36:00 Pacific
Subject: open pdf files in drop down menu's
Reply: (edit)

To open in a new window use your original code but use window.open instead of just open

Michael J


Report Offensive Follow Up For Removal

Response Number 10
Name: Michael J (by mjdamato)
Date: March 25, 2006 at 11:38:22 Pacific
Subject: open pdf files in drop down menu's
Reply: (edit)

Also, you might want to research the properties that you can pass to window.open such as a window name, by using a window name you can have a second pdf open up in the window of the first pdf if the user hasn't closed it already. There are some other attributes you might find useful as well.

Michael J


Report Offensive Follow Up For Removal






Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: open pdf files in drop down menu's

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software