• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

HTML brothers I need some code

AgentZap

Senior member
Might be a slightly wrong place to post this, but I am looking for a script for a navigation drop down list.

Basically it is a drop down menu list that when you click on whatever drop down choice it will take you to a corressponding web page. I have the one where you select it and then have to click second button to go there. That is annoying. Anyone know where I can get the better one?
 
I had the same problem. I eventually found an answer with server side scripting, can't remember if I ever found a java solution or not, but I imagine there must be one.
 
If someone can email me the script as well (preferable in PHP), that would be great. Need it for my website too. Actually I need two cases. I need one where a user chooses a product from a drop down menu and then chooses the operating system from a second drop down menu. Accordingly, the website then takes them to the correct website. Thanks. 😀
 
<select onChange="window.location.href=this.value;">
<option>Select</option>
<option value="http://forums.anandtech.com">AnandTech Forums</option>
<option value="http://swforums.com">Shadoworks Forums</option>
</select>
 
Or you can do it with tables and layers, though I don't recommend this, because not all browsers support it.
 
Insert this part into the HEAD

<script language="JavaScript">
<!--
function goToURL(form)
{

var myindex=form.dropdownmenu.selectedIndex
if(!myindex=="")
{
window.location.href=form.dropdownmenu.options[myindex].value;


}
}
//-->
</script>



This is your HTML

<form name="Redirect">
<select class=form_white name="dropdownmenu" size=1 onChange="goToURL(this.form)">
<option selected value="">
// Select a category
<option value="page1.html">
// Page 1
<option value="page2.html">
// Page 2
<option value="page3.html">
// Page 3
<option value="page4.html">
// Page 4
<option value="page5.html">
// Page 5
</select></form>
 
<form method="post" action="redirect.php">

<select name="url" onchange="javascript😀ocument.myform.submit()">
<option value="http://www.durdenwebapplications.com">Durden Web Applications</option>
</select>

</form>




-------------- redirect.php ---------------

<?php

if ($_POST['url']) {
header ("Location: " . $_POST['url']);
}


 
Can anyone help me with my script please? I need a script with two drop down menu's. Based on the two choices, the user is then taken to the appropriate page. Thank you very much in advance. 😀
 
Guys, instead of asking questions here - why not BROWSE sites like those listed here & work it out yourselve's. I wouldn't mind helping you if you've figured out the code & are having some small problems - but to just come in here & post 'gimme such & such code" is really lame. Can't you search the web yourself ? No one here will write the code for you, they're either searching for you (how weak is that - for those who can't search
rolleye.gif
) But we will help you edit code you find/write to make it work correctly.
 
Back
Top