Thread: Please help......
Results 1 to 2 of 2
-
07-12-2001, 03:39 PM #1
Please help......
OK i want to make a site where i will have a drop down menu. It's made with the form tag. I want it to be able to do the following:
When someone let's say clicks on the menu and it drops down and he/she clicks on let's say "Games", then I want it to be able to transfer the person the the Games page. I dont want to click on a "GO" button or anything. is there any way u can just choose the page u want to go to and then it automatically gets u there. Please tell me the code.
Thanks!
-
07-12-2001, 06:20 PM #2
Hello and welcome to the help desk!
A simple javascript can give you what you want. Here is the code as wriitin by Alex Tu of http://www.geocities.com/MadisonAvenue/4368
---put this in the <head> of your file---
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}
// End -->
</SCRIPT>
----------------------
---put this in the <body> of your file---
<form name="form">
<select name="site" size=1 onChange="javascript:formHandler()">
<option value="">Go to....
<option value="http://www.yahoo.com">Yahoo
<option value="http://www.metacrawler.com">Metacrawler
<option value="http://www.altavista.digital.com">Altavista
<option value="http://www.webcrawler.com">Webcrawler
<option value="http://www.lycos.com">Lycos
<option value="http://ahfb2000.com">Advanced HTML For Beginners</select>
</form>
good luck,
Dave