PDA

View Full Version : html help



Joe
09-04-01, 05:20 PM
Im messing with some crap and I need a drop down menu with a "GO" button that goes to the link specified in the menu.

I also need to be able to tell it what frame to go to... its an I-Frame.

All help appreciated.

colour
09-09-01, 09:22 AM
the following is what i use, it doesnt require a button as soon as you choose something from the drop down menu it directs the browser to the page.

first, this goes anywhere in the head of the document. this is important, it wont auto direct without it.

<script language="javascript">

function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}

</script>

second, this is the actual menu form.

<form name="form">
<select name="site" size=1 onChange="javascript:formHandler()" style="{ background-color: #FFFFFF }">
<option selected value=".html">text
<option vlaue=".html">text
<option value=".html">text
<option value=".html">text
<option value=".html">text
</select>
</form>

only things you should be changing are the "text" and the background color if you wish, also add your urls.

or you can just use this form generator for one with a go button.

http://javascript.internet.com/generators/drop-down-menu.html

heh, i should of just pasted that in the first place but just thought youd like to learn something.

as for having it target the iframe, i dunno how youd do that with this particular form.

but you can do it with regular links, you have to name the iframe.


<iframe src="" height="" width="" frameborder="" scrolling="" name=""></iframe>

then target your link to it.


<a href="" target="">url</a>

---

you can also link to a specific spot on the document using anchors.