The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Retrieving Documents
hankins27
post Nov 11 2010, 04:11 PM
Post #1





Group: Members
Posts: 2
Joined: 11-November 10
Member No.: 13,121



Please excuse if this is posting in the wrong area...

I'm looking for some advice on presenting the users with a drop-down list, allowing them to only choose one item, and then retrieving a pdf document based on their selection.

The documents are stored on the web server. This works fine for me (on a mac), unfortunately for most of the users (pc) it does not work. Regardless of what they select, it pulls up the document for the first item on the list.

Any help is greatly appreciated!!!!

****Here is the code*****
<form name="newsletterselect" action="xfer.php" method="GET"><div align="center">
<span class="style2">Select a newsletter from the drop-down list ...
<select name="xfer" size="1" onmouseup= "location = '' + this.options[this.selectedIndex ].value;">
<option value="Newsletters/alabama.pdf">Alabama</option>
<option value="Newsletters/alaska.pdf">Alaska</option>
<option value="Newsletters/arkansas.pdf">arkansas</option>
.
. (you get what the rest of the options look like)
.
<option value="Newsletters/wyoming.pdf">wyoming</option>
</select>
</span>
<noscript><input type="submit" value="Go!" /></noscript>
</div>
</form>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 11 2010, 07:17 PM
Post #2


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

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



Use onchange instead of onmouseup. Also, what's the purpose of the empty quote in the beginning of the location value?

CODE
location = '' + this.options[this.selectedIndex ].value;


If I don't miss something, this should be enough.

CODE
location = this.options[this.selectedIndex].value;


BTW JavaScript is all about browsers, not OS.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
hankins27
post Nov 15 2010, 04:48 PM
Post #3





Group: Members
Posts: 2
Joined: 11-November 10
Member No.: 13,121



Thanks so much for your help!!!! That does seem to have solved the problem. THANKS!!!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 15 2010, 07:47 PM
Post #4


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

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



You are welcome. smile.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 April 2024 - 01:02 AM