Make your own free website on

Making pull down and check box menues

These menues are not JavaScript. They are forms. They need a JavaScript function to be able to work as a link list. But for now here's how you make a plain menu somewhere on your page. <form>
<select name ="list" size=1>
<option>what you want here
<option>some more text
<option>and so on

The number after size decides what type of menu you end up with. With the size at 1 you will get the bar type pull down menu. If you put a larger number in there you will get a check box type menu like the one above on the left. If your number is smaller than the total number of options you will scroll through the unseen options.

Now this menu links to pages within this tutorial. In order for this to work I placed a JavaScript function up in the head of the page. The function is as follows.
<!-- Hide
function getSelect(s) {return s.options[s.selectedIndex].value}
// End Hide -->
With that function up in the head of the document you can now make a pull down menu that links. Here is how you make your menu now that you have the function to go with it
<select name="list" size=5 onChange="location=getSelect(this)">
<option value="http://url address here">Name of link
<option value="http://urs of second ling">name of link
repeated for as long as you have for
Now if you wanted a pull down bar style menu you would have put 1 in for the size. Also for the menu you would have to change the first option of the list to this
<option value="#">Word on first bar here

Also as with normal linking within your own pages you don't have to write out the entire URL. You just have put the last extension of the URL. All my files on this subject end like this. script1.html that is the address for page one. Instead of writing out wich would get quite tiresome if I hade to make a long menue and enter the first part of the address every time.

I do not know how these menues really work I'm just passing along the code for them. If you try and make one of these using this code and it doesn't work, You've probably made a simple error either in the script up above or in the form.

On the next page I will tell you how to write a script that will not start until the viewer of your page click on a box like this.

On to page 5

|| index||page 1||page 2||page 3||page 4||page 5||page 6||page 7||Page 8||