drop down menu

They have: 406 posts

Joined: Feb 2000

Thank you very much. Ya i think i might go with the button. Where do i put all the values i am going to use in the box and thier urls they will point to? Sorry not to good a javascript yet Thanks for your help

------------------
Adam
[email protected]

Best Regards,

Adam Lee
DigitalONE Design
President - Internet Division
[email protected]
digitalonedesign.com

They have: 406 posts

Joined: Feb 2000

Hello,

I was wondering how to create a simple drop down menu, so you can select a catagory like "products" or whatever and it will go to that page...Either that or when you select that and then have to hit like "enter or go" or something. Please help. Thanks..I dont know much about javascript.

------------------
Adam
[email protected]

Best Regards,

Adam Lee
DigitalONE Design
President - Internet Division
[email protected]
digitalonedesign.com

They have: 231 posts

Joined: Feb 2000

Insert the following between the <head></head> tags:

<script language="JavaScript">
<!-- hide script from old browsers

function navDropbox(URL) {
if (URL != "") {
window.location.href = URL;
}
}

// end hiding from old browsers -->
</script>

Insert the following between the <body></body> tags:

<form>
<select size="1"
onChange="javascript:navDropbox(this.options[selectedIndex].value)">
<option value="">Select Destination:</option>
<option value="http://www.hotmail.com">Hotmail</option>
</select>
</form>

If you would like a dropbox with a button I can adjust the script for you.

------------------
Lloyd Hassell
[email protected]
http://go.to/hass

:: Lloyd Hassell :: http://www14.brinkster.com/lloydh ::

They have: 231 posts

Joined: Feb 2000

You put the values you are going to use inside the <option> tag.

eg. <option value="URL">NAME

If you want to use a "GO" button try this:

<form>
<select size="1" name="destination">
<option value="">Select Destination:</option>
<option value="http://www.hotmail.com">Hotmail</option>
</select>
<input type="button"
onClick="javascript:navDropbox(this.form.destination.options[this.form.destination.options.selectedIndex].value)">
</form>

------------------
Lloyd Hassell
[email protected]
http://go.to/hass

:: Lloyd Hassell :: http://www14.brinkster.com/lloydh ::

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi,

If you want, see the "Select & Go Menus" script at my site. It demonstrates & discusses both types of dropdowns (pros & cons). The no-button version includes a "doSel()" function that can be used to eval() most any type of code.

Vinny

------------------
GrassBlade: cut&paste javascript

Where the world once stood
the blades of grass cut me still

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.