PDA

View Full Version : Text Tield code?


dionysos
01-14-2004, 04:58 PM
I have this Text Tield code. You select an item from the dropdown and click the Submit button, and you are taken to the destination url. But I cant make it work.....

Anyone knows hov it should look, to lets say: go to google on Location 1, and yahoo on Location 2?




<span class="text">Select a location in the list below<br>and click the "Go"
button.</span><br><br>

<SCRIPT LANGUAGE="JavaScript">
<!--function goto_URL(object) {
window.location.href = object.options[object.selectedIndex].value;
}
//--></SCRIPT>

<select name="selectName" style="font-size:9px;">
<option value="destination_url1.htm">Location 1</option>
<option value="destination_url2.htm">Location 2</option>
<option value="destination_url3.htm">Location 3</option>
</select>

<input type="button" value="Go" onClick="goto_URL(document.dynamiclist.selectName)">

amadman
01-14-2004, 07:19 PM
I don't know if this is what you want but here is how I did mine:

<FORM name="navform">
<font size="2">Pick One</font>
<SELECT name="navlinks">
<OPTION SELECTED value="http://www.google.com">First Place
<OPTION value="http://www.yahoo.com">Second Place
</SELECT>
<INPUT type="button" name="go" value="Go!" onClick="window.location=document.navform.navlinks.options[document.navform.navlinks.selectedIndex].value"> </FORM>

Cleo
01-14-2004, 07:48 PM
This is the code that I use,

<form>
<select name="menu1" onchange="if(this.options[this.selectedIndex].value!=''){window.open(this.options[this.selectedIndex].value,'_top')}">
<option value="#" selected="selected">Drop Down Menu</option>
<option value="http://www.cleolinks.com">Cleo's Links</option>
</select>
</form>

dionysos
01-14-2004, 08:10 PM
Sorry fore posting in the rong forum.

Thank you fore the cods, but I just worked it out.

What im looking fore now is a drop down menu that will show a different pop up on each selection. Ill go ask on a html forum. But if someone just happens to have a code like that.....then give it to me |smooch|