PDA

View Full Version : Pop Up Menus


Letrell
03-08-2000, 12:20 PM
I feel like a kid here.....I'm a graphic designer just turning to website creation. I'm attempting to add my first pop up menu and am having problems adding a value to each selection. UGH! Everything I find says, "add a value to each entry". Great. I don't know what the definition of this kind of "value" is. Anyone feel like walking a lady through this? I am using PageMill on this site and placing a pop up with a list of years for archive issues of a magazine. (www.sandiegooffroad.com)

Thanks.
Letrell

Owen_MC_Evans
03-08-2000, 01:06 PM
Well Letrell,
One thing I need defining to answer the question properly. By "Pop up menu" do you mean one that list's links in a combo box (like the "hop to:" menu at the bottom of this page) or do you mean a menu that "Pop's up in a separate screen?
I presume by you reference to Value that you mean the former.

Your confusion over values in this instace is quite well founded in that combo boxes hold valuse in Name : Value Pairs. for example if you look at the code for the combo box on this page (done by clicking on view and source)
then you will see it is set up as follows:
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>
&lt;SELECT NAME="number"&gt;
&lt;OPTION value="" SELECTED&gt;Select a Forum
&lt;OPTION value=""&gt;
&lt;OPTION value=""&gt;List of Forums:
&lt;OPTION value=""&gt;
&lt;OPTION VALUE=""&gt;
&lt;OPTION VALUE=""&gt;123webmaster
&lt;OPTION VALUE=""&gt;--------------------
&lt;OPTION value="9"&gt;Announcements
&lt;OPTION value="10"&gt;Feedback
&lt;OPTION value="11"&gt;Guides and Moderators
etc..............&lt;/SELECT&gt;
<HR></BLOCKQUOTE>
There are only three selections that actually show links "announcements "Feedback" "Guides and Moderators"
now you will notice that each of these options has it's own "value=" statement this is the value that is stored in the selectedIndex.value string in Javascript. as such you can set up a simple script that could be set out as follows:-
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>
I have presumed you are refering to the Archives section of your site:
&lt;Script language = "JavaScript"&gt;
&lt;!--
function goToLink() {
' this set up a function called goToLink

baseURL= "arch"
'as all the pages begin with "arch" this does not need to be part of the value

endURL = ".html"
let select = document.NameOfYourForm.NameOfSelectField
=this references the form and select box
URLvalue = select.value
this gets the value
let URL = baseURL & URLValue & endURL
window.location = URL
}
--&gt;
&lt;/SCRIPT&gt;

<HR></BLOCKQUOTE>
then all you have to do is create the combo box as described above with just the date as values!

Hope this explanes it
Owen