PDA

View Full Version : Drop-down menu



WorldWarGeneral
June 28th, 2001, 16:14
I'd like to make a navigational drop-down menu for my site (Like the one at http://www.geocities.com/Athens/Atrium/1426/) However, after I made it, whenever I test the form, all I get is a page that says:

"Method Not Allowed
The requested method POST is not allowed for the URL /index.html."

I'm using f2s, if that means anything. I tried testing the form on f2s and Tripod. Tripod gives me a "405 - Resource not allowed" error. Is there something I'm doing wrong? I'm using frontpage 2000 (yeah, I know - HUGE mistake on my part, but I got mixed up with it, and I haven't decided on what the easiest way to switch my site over to Notepad or something similar is) to make the form.

If anyone knows that I'm doing wrong (it's probably something really stupid and something I should know) I'd appreciate any help. Even the way to do it in Notepad would be appreciated.

Thanks!

lucifer
June 28th, 2001, 16:28
where's your page?

WorldWarGeneral
June 29th, 2001, 08:54
http://www.worldwarhistory.com

gyrbo
June 29th, 2001, 11:05
That code is caused by sending data (GET or POST) to an html file.
Here is some code that should work:


<!-- Place this in the <head> -->
<script language="javascript">
function go()
name= menu.menu.value
if(name=="Home"){top.location.href="index.html";}
if(name=="Links"){top.location.href="links.html";}
</script>

<!-- Place this in the <body> where you want the nav-->
<form method="POST" name="menu>
<p><select name="menu" size="1">
<option>Home</option>
<option>Links</option>
</select><input type="button" OnClick="go();" name="Go" value="GO"></p>
</form>

Darin
June 29th, 2001, 14:58
Here is the exact code you need. It uses JavaScript so you will have to download the file attached. Rename the file to .js


Inser the code below in the <head> section of your site:

<SCRIPT LANGUAGE="javascript" SRC="txt.js"></SCRIPT>

Copy and paste this code into the <body>
of your html document.....Edit the link to your liking.

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function selectaplace(form) {
var appname= navigator.appName;
var appversion=parseInt(navigator.appVersion);
if (appname == "Netscape" && appversion >= 3) {
var formindex=form.select1.selectedIndex;
var storage=form.select1.options[formindex].text;
if (form.select1.options[formindex].value != "none") {
var msg=storage+"You are now being transferred to the -> "+storage;
for (var spot=0;spot<msg.length-storage.length;spot++) {
var x=msg.substring(spot,msg.length);
form.select1.options[formindex].text=x;
for(var d=0;d<150;d++) { };
}
window.location=form.select1.options[formindex].value;
form.select1[formindex].text=storage;
} else {
form.select1[formindex].text="Not a real option!";
for(var d=0;d<1250;d++) { };
form.select1[formindex].text=storage;
}
}
else {
var formindex=form.select1.selectedIndex;
window.location=form.select1.options[formindex].value;
}
}
function makeMyMenu() {
document.write ('<form><select name="select1" onChange="selectaplace(this.form)" size=1>');
document.write ('<option value=http://javascriptsource.com>The JavaScript Source');
document.write ('<option value=http://bgeffects.javascriptsource.com>Background Effects');
document.write ('<option value=http://buttons.javascriptsource.com>Buttons');
document.write ('<option value=http://calculators.javascriptsource.com>Calculators');
document.write ('<option value=http://calendars.javascriptsource.com>Calendars');
document.write ('<option value=http://clocks.javascriptsource.com>Clocks');
document.write ('<option value=http://cookies.javascriptsource.com>Cookies');
document.write ('<option value=http://forms.javascriptsource.com>Forms');
document.write ('<option value=http://foldertree.javascriptsource.com>Folder-Tree');
document.write ('<option value=http://games.javascriptsource.com>Games');
document.write ('<option value=http://messages.javascriptsource.com>Messages');
document.write ('<option value=http://miscellaneous.javascriptsource.com>Miscellaneous');
document.write ('<option value=http://page-details.javascriptsource.com>Page Details');
document.write ('<option value=http://passwords.javascriptsource.com>Password Protection');
document.write ('<option value=http://scrolls.javascriptsource.com>Scrolls');
document.write ('<option value=http://user-details.javascriptsource.com>User Details');
document.write ('</select>');
document.write ('</form>');
}
makeMyMenu();

// End -->
</SCRIPT>

Hope this helps! You can see a working demo on my web site on the front page.

Darin
June 29th, 2001, 15:00
Sorry, it seems as though I removed the drop down menu from my website a while ago, I still remember it as being there. The file didn't attach properly, so you can download it at: http://www.draac.com/txt.js

gyrbo
June 29th, 2001, 16:27
Wow, my code is just a little shorter, I wonder why?

Darin
June 29th, 2001, 17:05
This one uses JavaScript, so it's much more powerful.

gyrbo
June 30th, 2001, 03:20
Mine does to, What do you think the first line of code I gave were?

lucifer
July 1st, 2001, 06:42
Wow, my code is just a little shorter, I wonder why?

maybe cos you wrote it yourself? ;)